You are looking for the word addr: followed by four groups of digits, three of which are separated by a dot. Therefore you want
$string =~ /addr:(\d+\.\d+.\d+\.\d+)/; Now, $1 has the correct ip address. -----Original Message----- From: Daniel Falkenberg To: [EMAIL PROTECTED] Sent: 10/4/2001 6:43 PM Subject: Help with regular expression. List, I have an IP address within this regular expression that I need extracting and stored in a variable. Could some one offer some help on this? The line is as follows... inet addr:144.137.215.25 P-t-P:172.31.28.24 Mask:255.255.255.255 I need to extract the inet addr: i.e 144.137.215.25 and store it in a variable. I am very new to regexes. So any help would be greatly appriciated. Daniel Falkenberg. ============================== VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL PROTECTED] WWW: http://www.vintek.net Tel: (08) 8523 5035 Fax: (08) 8523 2104 Snail: P.O. Box 312 Gawler SA 5118 ============================== -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]