cancel
Showing results for 
Search instead for 
Did you mean: 
AndrewRobinson
Nintex Newbie

Time regular expression

Jump to solution

Good evening,

 

I single line of text field that I'm using for users to enter in a time. I'm validating the field using this regular expression: ^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$

 

It works fine for putting in a time of, for example, 1:30 however I am wondering if there is a way to allow the user (or better yet force the user) to add AM or PM after the time.

 

All help is appreciated.

Andrew

Labels: (1)
Tags (1)
0 Kudos
Reply
2 Replies
emha
Nintex Newbie

Re: Time regular expression

Jump to solution

sure, something like this shouldw work

 

^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]\s(AM|PM)$

 

                  

 

 

 

Reply
AndrewRobinson
Nintex Newbie

Re: Time regular expression

Jump to solution

Thanks @emha. It works perfectly.

0 Kudos
Reply