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
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
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
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:
[...]
* 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
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
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