Manish Sapariya [MS], on Tuesday, May 17, 2005 at 17:38 (+0530) has on mind:
MS> echo "1: 192.168.0.180:32866 - 192.168.0.183:143 (a2b) MS> 17> 14< (complete)" | perl -lane 'print$_;if($_ =~ MS> /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d{1,5}) - MS> (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d{1,5})/) {print "Source IP MS> = $1, Source Port = $2, Destinatin IP = $3, Destination Port = MS> $4\n"}' some ideas how to write ip: ((?:\d{1,3}\.){3}\.\d{1,3}) (\d{1,3}(?:\.\d{1,3}){3}) good idea is store regexp into variable and use that variable in regexp. $ip = ((?:\d{1,3}\.){3}\.\d{1,3}) /$ip:(\d{1,3})\s*-\s*$ip:(\d{1,3})/ of course you can do that with port too. -- How do you protect mail on web? I use http://www.2pu.net [A revolving lithic conglomerate accrues no lichen.] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>