[EMAIL PROTECTED] (Perl-Krackedpress) writes:
> // check the email fields for validity
> "^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$"
That will invalidate lots of proper email addresses. For example
anything in the .info domain.
For example [EMAIL PROTECTED] is also a valid em
Zentara wrote:
> On Mon, 19 Aug 2002 12:07:21 -0700, [EMAIL PROTECTED] (Root) wrote:
>>for a one liner:
>>
>>$_ = '12.34.56.78';
>>map {$_ < 256} /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g || warn("not valid ip:
>>$_\n");
>>
>
> I tried this with $_ = '1234.2345.56.78'; and received no warning.
> That's n
er.. see correction
> -Original Message-
> From: Angerstein [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 20, 2002 9:00 AM
> To: [EMAIL PROTECTED]
> Subject: AW: how to make a regex for a ip address
>
>
> What about:
> /\d?\d?\d\.\d?\d?\d\.\d?\d?\d\.\d?\d?\d\/
/^\d{1,3}\.\d{1,3}\.
On Mon, 19 Aug 2002 12:07:21 -0700, [EMAIL PROTECTED] (Root) wrote:
>for a one liner:
>
>$_ = '12.34.56.78';
>map {$_ < 256} /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g || warn("not valid ip: $_\n");
>
I tried this with $_ = '1234.2345.56.78'; and received no warning.
That's not good.
--
To unsubscribe,
Emmm... So do you want to do it in 1 line or your just want to try
on ? For me, it seems quite non-effective & impossible with one line...
but breaking them into pieces, that becomes handy. I use this :
my $ip = $ENV{REMOTE_ADDR};
my $error = 0;
my @seg = split /\./, $ip;
$error = 1 unless ($
From: perl-Krackedpress [mailto:[EMAIL PROTECTED]]
Sent: Sunday, August 18, 2002 9:12 PM
To: Janek Schleicher
Cc: [EMAIL PROTECTED]
Subject: Re: how to make a regex for a ip address
I hope you have a good REF. for regex commands
O'Reilly's series book is the best I am told.
I do
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 18, 2002 1:24 PM
Subject: Re: how to make a regex for a ip address
> Alex Chen wrote at Sun, 18 Aug 2002 17:14:21 +0200:
>
> > i am a beginners in perl.i am studying perl regex now ,and i want to
know
> > how to make a regex f
Alex Chen wrote at Sun, 18 Aug 2002 17:14:21 +0200:
> i am a beginners in perl.i am studying perl regex now ,and i want to know
> how to make a regex for a ip address.
Have a look to the
Regexp::Common
module from the CPAN.
$RE{net}{IPv4} contains the regexp to match an ip address.
Best Wis