But that would match 000255.000255.000255.000255.
hehehe :) I like the split loop check. > -----Original Message----- > From: Samy Kamkar [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 20, 2002 9:02 AM > To: Angerstein > Cc: [EMAIL PROTECTED] > Subject: Re: AW: how to make a regex for a ip address > > > /^(?:0*(?:2(?:[0-4]\d|5[0-5])|1?\d{1,2})(?:\.|$)){4}/ > > -Samy > > Angerstein wrote: > > > What about: > > /\d?\d?\d\.\d?\d?\d\.\d?\d?\d\.\d?\d?\d\/ > > > > or > > > > @ip = split (/\./); > > foreach $part (@ip) { > > if ( $part > 255 && $part =~ /\d?\d?\d\/ ) { > > die "That´s not an IP"; > > } > > } > > > > > >>-----Ursprüngliche Nachricht----- > >>Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im > Auftrag von > >>zentara > >>Gesendet am: Dienstag, 20. August 2002 14:50 > >>An: [EMAIL PROTECTED] > >>Betreff: Re: how to make a regex for a ip address > >> > >>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, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > > > > > > > -- > Samy Kamkar -- cp5 -- [EMAIL PROTECTED] > LucidX.com / LA.pm.org / code.LucidX.com > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ---------------------------------------------------------------------------- -------------------- The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]