Hi Gerd,

It was foretold that on Tuesday, December 11, 2001 at 11:14 GMT +0100,
Gerd Ewald [GE] would type:

>> You're missing ranges.  One that might work better is:

>> (\d|\d\d|[01]\d\d|2[0-5][0-5])\D

Heh, mine is wrong too.  Mine will miss 206-209, 216-219, 226-229,
etc.

GE> When I wrote mine I remembered a regex which was printed in *Friedel*,
GE> but was too lazy to look it up. Here it is:

GE> 
([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])

That'll work.

GE> Still 0.0.0.0 is possible, but this another story.

Friedel's regexp will catch this case too.  We can take this to TBTECH
if you want to know how.

Hints: 1. Look at the first alternative for each set of numbers.
       2. Remember, \d matches *any* digit.
       3. What does the repeat operator '?' do?

-- 
Thanks for writing,
 Januk Aggarwal

Using The Bat! 1.54 Beta/15 under Windows 98 4.10 Build 67766446 A

OK, I'm weird! But I'm saving up to become eccentric.


-- 
________________________________________________________
Archives   : http://tbudl.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
TBTech List: mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]
Latest Vers: 1.53d
FAQ        : http://faq.thebat.dutaint.com 

Reply via email to