In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Ing. Branislav Gerzo) writes: >PS> This isn't shorter, but it is easier to understand :-) > >PS> /^(\d+)(??{ $1 > 0 && $1 < 256 ? "" : "(?!)" }) \. >PS> (\d+)(??{ $2 > 0 && $2 < 256 ? "" : "(?!)" }) \. >PS> (\d+)(??{ $3 > 0 && $3 < 256 ? "" : "(?!)" }) \. >PS> (\d+)(??{ $4 > 0 && $4 < 256 ? "" : "(?!)" }) >PS> $/x > >PS> There's probably a way of collapsing that into one expression >PS> with a {4} after it, but I don't feel like looking for it. > >this is also nice example, thanks for postin, I didn't read about >(??{}) and (?!) construction, it is really handy. But I think, there >is a little error, try matching 123.0.0.1.
True. Well, easily fixed, at least. >PS> Jeff Pinyan would know. > >why is that ? Uh, because he knows this stuff... see some of his articles... -- Peter Scott http://www.perldebugged.com/ *** NEW *** http://www.perlmedic.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>