http://qs321.pair.com?node_id=718166

sanjay nayak has asked for the wisdom of the Perl Monks concerning the following question:


Hi Monks

Plz suggest me a suitable Regular expression for the following conditions.

REGISTER or INVITE or BYE (space) some text or digit or both -(hypen) or @ or _(underscore sign) some text or digit or both . some text or digit or both space SIP/2.0.

For example

my $text="REGISTER acti-abc.test SIP/2.0";

If ($text ~= /^REGISTER|INVITE|BYE\s\w\.\w\sSIP\/2.0/)

The above is not working properly, Plz suggest me a suitable regular expression for the above.

Regd's
Sanjay