Hi,
     I am a novice to perl programming. When I execute the following code, I get 
always "No Match". I guess my reg-exp is correct. I also tried changing $line= "INVITE 
sip:[EMAIL PROTECTED] SIP/2.0"; to have double quotes and a backslash char before @ 
symbol. Even then it gives me No Match. I appreciate your help.
 
#!/usr/bin/perl -w
my $line= 'INVITE sip:[EMAIL PROTECTED] SIP/2.0';
if($line =~ /^\s*(\w+)\s*(.*)\s+(sip\/\d+\.\d+)\s*\r\n/i)
{
    print "\nSIP Method: ",$1;
    print "\nRequest URI: ",$2;
    print "\nSIP Version: ",$3;
}
else
{
    print "No Match";
}

Thanks,
Balaji

Yahoo! India Mobile: Ringtones, Wallpapers, Picture Messages and more.Download now.

Reply via email to