Extract time from String

前端 未结 2 729
清酒与你
清酒与你 2021-01-27 21:23

I have this string which is a result of net time \\SERVER_NAME command in cmd :

Current time at \\SERVER_NAME is 3/31/2014 9:35:57 AM

2条回答
  •  心在旅途
    2021-01-27 22:13

    The simplest regex to only match the time would be something like:

    \d\d?\:\d\d\:\d\d\s?(A|P)M
    

    Is that what you're after?

提交回复
热议问题