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.

PS> Jeff Pinyan would know.

why is that ?

-- 

 ...m8s, cu l8r, Brano.

[Minnesota - home of blonde hair and blue ears.]



-=x=-
Skontrolované antivírovým programom NOD32


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to