Hello Januk Aggarwal ! On Tue, 11 Dec 2001 11:27:40 -0800 GMT your local time, which was 11.12.2001, 20:27 (GMT+0100) where I live, you wrote:
GE>> What I meant was, that this regex matches an invalid/impossible GE>> IP-Number. I hope you understood me that way. > Actually, I thought you meant it won't catch 0.0.0.0. Oh well. I thought so, because I wrote it in a way that could be misunderstood. My fault. [...] GE>> [...] one could check with a look-ahead assertion. > That's probably the best way, but you'll need to use a conditional > regexp for the assertion to work correctly. So it would look > something like: > >(?(?!0+\.0+\.0+\.0+)([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])) Works like a charm. I admit that I do not use conditional regexp very often when I write a script in Perl. I usually check the result by other methods. But this one looks really nice. :-)) Thanks for that. It saves my some lines of code. I should do more with these conditionals!! -- Best regards, Gerd ====================================== Using The Bat! Version 1.53t PGP/GPG-Keys on request mailto:[EMAIL PROTECTED]?subject=send_key ---------------------------------------------------------------------------- Prevention is better than cure. -- ______________________________________________________ Archives : http://tbtech.thebat.dutaint.com Moderators : mailto:[EMAIL PROTECTED] Unsubscribe: mailto:[EMAIL PROTECTED]
