Re: extracting substr

2001-06-11 Thread Karen Cravens
On 10 Jun 2001, at 10:05, Dave Cross wrote: > On Sat, Jun 09, 2001 at 06:33:21PM -0500, Karen Cravens ([EMAIL PROTECTED]) wrote: > > Someone can probably fine-tune which places don't > > actually need three digits and whatnot, too. > It can be a bit more complex that that tho'. The first diit i

Re: extracting substr

2001-06-11 Thread Dave Cross
On Sat, Jun 09, 2001 at 06:33:21PM -0500, Karen Cravens ([EMAIL PROTECTED]) wrote: > 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 i

Re: extracting substr

2001-06-10 Thread Matt Cauthorn
This works for me... #!/usr/bin/perl -w while (<>){ print if $_=~/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/; } Regards, Matt --- William <[EMAIL PROTECTED]> wrote: > hi, > > i want to be able to read a text file and extract only the valid > ip addresses. however, along with valid ip addres

Re: extracting substr

2001-06-09 Thread William
thanks, Karen & Iain, et el,, this helps greatly. the book is on order, can't believe the title of that section, gee. ;-) Bill Karen Cravens wrote: iain truskett wrote: [...]

Re: extracting substr

2001-06-09 Thread iain truskett
* William ([EMAIL PROTECTED]) [09 Jun 2001 23:26]: > hi, > i want to be able to read a text file and extract only the valid > ip addresses. however, along with valid ip addresses my code is > grabbing "periods" and invalid ip addresses, e.g., .xxx, > www.xxx.yyy . how can i correct this? It migh

Re: extracting substr

2001-06-09 Thread Karen Cravens
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 s

extracting substr

2001-06-09 Thread William
hi, i want to be able to read a text file and extract only the valid ip addresses. however, along with valid ip addresses my code is grabbing "periods" and invalid ip addresses, e.g., .xxx, www.xxx.yyy . how can i correct this? = while () { chomp; if (($L) = ($_) =~ m/\b([0-9.0-9.0-9.0