[Tutor] regex newbie question

Steve Willoughby steve at alchemy.com
Thu May 8 20:21:34 CEST 2008


On Thu, May 8, 2008 10:51, Dick Moores wrote:
> <html>
> <body>
> Could someone tell me what's wrong with this regex?<br><br>

The main thing is that you're forgetting that a RE matches anywhere
in the string.

\b\d+/\d+/\d{2,4}\b matches

4/4/2009
12/12/555

\b\d{1,2}/\d{1,2}\b matches

4/4/2009
4/4/12345
12/12/555
12/12
2/2
2/12





More information about the Tutor mailing list