Rob B. wrote:
It worked for me. I also changed the separators to simple character
classes and placed the year parts in non-capturing parentheses as
=> [“12/31/1965”, “12”, “31”, “1965”]
What are you trying that “doesn’t validate”?
Thanks for your reply, Rob.
I have an optional date_of_birth field – if it’s filled in, I’m trying
to validate the date format with that regexp. The data I’m entering in
the date_of_birth text field is a simple date:
The expression I provided - when used in it’s entirety, would fail
validation. When I used only the first portion, it validated properly.
After adding the 2nd portion, it failed (even though the syntax is
I’ll try your modified expression to see if that goes thru. Is there
anything that would prevent a valid regexp from not processing correctly
– that could be environment-oriented? I use an regexp for my e-mail
validation that works fine though.
I’m running Windows XP, Ruby 1.8.2, and Rails.
Again - thanks for the help.