MyBB Community Forums
Regular Expression Question - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: Regular Expression Question (/thread-164916.html)



Regular Expression Question - xbeatle - 2014-12-30

So, I'm making Birth dates mandatory and want to show the format that users will need to use.

05/30/1974

How would I make that into a "Regular Expression"?

Thanks so much in advance..

J.


RE: Regular Expression Question - Destroy666 - 2014-12-30

http://stackoverflow.com/a/15504877


RE: Regular Expression Question - xbeatle - 2014-12-30

Not sure I understand.

So I tried entering one of the provided formulas from the link you supplied(see below) in the Regular Expression box field on the Edit Profile page and still get the same error message...

"Please correct the following errors before continuing:

You did not enter a valid value for the "Birthday" field. Please enter a valid value before continuing."

"^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.]((19|20)\\d\\d)$"

What might I be doing wrong?

Thanks in advance..

J.


RE: Regular Expression Question - Destroy666 - 2014-12-31

I linked a specific regex, did you try it?

Anyways, I don't see any point of using a textbox profile field, you can use this plugin instead: http://mods.mybb.com/view/date-of-birth-on-registration


RE: Regular Expression Question - xbeatle - 2014-12-31

Thanks man as I appreciate the detailed instructions..

Hadn't used Plugins before and now I know how to do it..

First Templates and now Plugins..awesome.

Thanks again for quick replies...

J.