Regex to match mm/dd/yyyy hh:mm:ss AM or PM

后端 未结 5 1259
逝去的感伤
逝去的感伤 2021-01-22 16:57

I have a program that creates information for a time stamp, the time stamp has to match the following format: MM/DD/YYYY HH:MM:SS AM or PM

For example:

5条回答
  •  情话喂你
    2021-01-22 17:34

    Try this . I hope i understood your question. Tested here http://rubular.com/ and it works.

      ^(\d{1,2}\/){2}\d{4}\s+((\d+)(\:)){2}\d+\s+(AM|PM)
    

提交回复
热议问题