On 9 Jun 2001, at 16:21, William wrote:

>    if (($L) = ($_) =~ m/\b([0-9.0-9.0-9.0-9]+)\b/ ) {

A valid IP address is going to look like four groups of one to three 
digits separated by dots.

So if "one to three digits" is \d{1,3} (\d is the same as [0-9]), the 
regex is going to want to look something more like

/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/

Notice the quoted-metacharacter dots, otherwise you'll get wacky 
matches.

Now, the \b's are probably rendered moot by greediness, so unless 
you are trying to avoid picking up "x12.34.56.78" you can take 
those out.  Someone can probably fine-tune which places don't 
actually need three digits and whatnot, too.

-- 
Karen J. Cravens ([EMAIL PROTECTED])

Reply via email to