Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
(?:(?<!\d|\-|\+|\.)(?P<ch_a>[\u4e00-\u9fff]{2})?(?P<Hours>[0-2]?\d)(?:[:\.时時]| ?h ?)(?P<Minutes>[0-5]\d(?!\d))\:?(?:(?:[:\.]| ?m ?)(?P<Seconds>[0-5]\d(?!\d)))??(?:[,\.](?P<SecodsFraction>\d{9}|\d{6}|\d{3}(?!\d)))?(?:\ \w\W)?(?:[\.\s]?(?:(?P<Z>(?:[a-zA-Z]{3,5}|Z|\[\w+\/\w+\])|(?:[+-]\d\d?\:?[0,3,4]?[0,5]?))|(?P<a>[dapmDAPM]{2})))*(?!\S))
"
gm

Description

Grab time from datetime

Submitted by anonymous - 4 years ago