Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: What is regular expression for the following thing?

by Punitha (Priest)
on Oct 20, 2008 at 09:13 UTC ( #718171=note: print w/ replies, xml ) Need Help??


in reply to What is regular expression for the following thing?

Hi sanjay nayak

You can have a quick reference about the perl regular expressions here http://perldoc.perl.org/perlrequick.html

Moreover in your example coding you misused the matching operator. It should be =~ and you may want something like this

if ($text =~ /^(?:REGISTER|INVITE|BYE)\s\w+[-@_]\w+\.\w+\sSIP\/2\.0/) { print "IN:$text\n"; }

Punitha


Comment on Re: What is regular expression for the following thing?
Select or Download Code
Replies are listed 'Best First'.
Re^2: What is regular expression for the following thing?
by ikegami (Pope) on Oct 20, 2008 at 09:18 UTC
    I think you meant [-\@_].
    >perl -le"@_='abc'; print qr/[-@_]/;" (?-xism:[-abc])

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://718171]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2015-07-30 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls