----- Original Message ----- From: "Messier, Jean-Francois" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "Daniel Falkenberg" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, December 07, 2001 12:06 AM Subject: RE: Confirmation...
> I'm a beginner in those regular expressions and s/// operations. How > can I extract only the digits and the periods (.) from a string ? I have > something like 206.48.16.3/12345. An IP address with a port number. There > are digits on both sides of the slash, but I would like to keep only the > digits from on the left as well as the periods. More complex question: If I > have something like "src=206.48.16.3/12345", how can I do the same as bove, > but also removing the "src=" at the beginning ? This /([\d.]*)\/.*/g works irregardless whether your ip is 206.48.16.3/12345 or src=206.48.16.3/12345 $ip = 'src=206.48.16.3/12345'; $ip =~/([\d.]*)\/.*/g; print $1; $ip = '206.48.16.3/12345' ; $ip =~/([\d.]*)\/.*/g; print $1; _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]