[Tutor] regex newbie question

Dick Moores rdm at rcblue.com
Thu May 8 21:40:28 CEST 2008


At 11:46 AM 5/8/2008, Steve Willoughby wrote:
>Be aware that \d{2,4} matches 2, 3 or 4 digits, which may be
>different than what you're looking for, since 1/12/234 would
>match

Yes, I wanted to permit that. In my script, mxDateTime turns 1/12/234 
into 01/12/0234. So if a user wants to enter it, I'll let him.

But here's a chance to ask: What regex would match 2-digit strings 
and 4-digit strings only?

And another: What regex matches the "" string?

Dick 



More information about the Tutor mailing list