News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Input mask with regular expression

Started by codebirth, January 02, 2009, 05:27:55 AM

Previous topic - Next topic

codebirth

Hello,

I have added a custom profile field and want it to accept a time with the format HH:MM:SS so I use the following mask

^([0-9][0-9]):([0-5][0-9]):([0-5][0-9])$

I want to accept from 00:00:00 to 99:59:59 but is accepting any text, even letters.

What I'm doing wrong?

codebirth

Solved. I forgot to add ~ on the edges

~^([0-9][0-9]):([0-5][0-9]):([0-5][0-9])$~

Advertisement: