in reply to help defining regular expressions
You cannot use && inside a regex. But you can use it outside:
if( $packet !~ m/sip/ && $packet !~ m/sdp/ ) { print "packet is RTP\n"; } elsif( $packet =~ m/sip/ ) { if( $packet =~ m/sdp/ ) { print "packet is sdp\n"; } else { print "packet is sip!\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: help defining regular expressions
by bigmoose (Acolyte) on Dec 14, 2011 at 09:51 UTC |