Hi All, I have a pattern, which reads as shown below:
my $comment = qr{\s* (?:/\* .*? \*/ \s*)*}xs; my $identifier = qr{ [A-Za-z_]\w* }xs; my $statement = qr{ \s* ($identifier) \s+ ($identifier) \s* (?: \[ (.*?) \] )? \s* ; \s* $comment? }xs; my @m = $abc =~ /$statement/g; My string reads as shown below: $abc = "typedef struct _MSG_S { CALL_ID callId; /**< call id */ VOICE_STATUS status; /**< Call status */ id_t id; /**< The id of process call */ } TAPI_VOICE_NOTIFY_CALL_STATUS_MSG_S;"; The condition $abc =~ /$statement/g; is not satisfied. The array @m is not being filled. I am unable to find out the mistake. Is the pattern regex wrong somewhere? Thanks and Regards, Dharshana