Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私の正規表現は、次のタイプの書式設定された時刻文字列と一致します。
12:30 12:30 AM 12:30 pm 1:30 1:30 AM
((?:(?:[0-1][0-9])|(?:[2][0-3])|(?:[0-9])):(?:[0-5 ][0-9])(?::[0-5][0-9])?(?:\s?(?:am|AM|pm|PM))?)
am/pmを必要とするように式を変更するにはどうすればよいでしょうか? 手を差し伸べてくれる人はいますか?
ありがとう!
最後の「?」を削除します。
((?:(?:[0-1][0-9])|(?:[2][0-3])|(?:[0-9])):(?:[0-5 ][0-9])(?::[0-5][0-9])?(?:\s?(?:am|AM|pm|PM)))