Welcome Guest, Not a member yet? Register   Sign In
regular expression
#6

[eluser]Aken[/eluser]
ClaudioX, I see that you added a lot more validation as far as date and time ranges. Ignoring some of the small bugs still in it, I wouldn't recommend such a regex when it comes to validating dates, because 99% of the time you'll still need to verify things like if the date is within a set timeframe, if it actually is a leap year so February 29th is acceptable, etc. I realize mine is incredibly basic and only verifies the number pattern, but I think because of the other sanitizing that needs to be done, that's the most you'd want to validate against when it comes to user input.

I might spruce up your regex a bit and post it here regardless, just as like a tutorial or "in case you want it" type thing. If you'd like to know how you can fix your regex a bit, just let me know and I'd be happy to share some suggestions.


Messages In This Thread
regular expression - by El Forum - 07-31-2011, 11:25 AM
regular expression - by El Forum - 07-31-2011, 04:14 PM
regular expression - by El Forum - 07-31-2011, 04:30 PM
regular expression - by El Forum - 07-31-2011, 05:15 PM
regular expression - by El Forum - 07-31-2011, 09:10 PM
regular expression - by El Forum - 08-01-2011, 12:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB