You could try something like this:
\d{1,2}/\d{1,2}/\d\d(?\d\d)?
Of course, that's only using slashes, not dashes or dots or spaces, but
it should give you the right idea.
--BenD
Mark A. Kruger - CFG wrote:
> Regex gurus,
>
> I have a string and I want to ensure that the date format is:
>
> xx/xx/xxxx or x/x/xxxx or x/x/xx (you get the idea)
>
> Does anyone have a stock regex for this? Am I going to need more than 1
> or can I look at everything (length, format and
> range of numbers) in 1 regex?
>
> -mark
>
> Mark A. Kruger, MCSE, CFG
> www.cfwebtools.com
> www.necfug.com
> http://blog.mxconsulting.com
> ...what the web can be!
>
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- OT: Regular expressions in JS (or in general) for dat... Mark A. Kruger - CFG
- Ben Doom