Created
June 19, 2019 18:34
-
-
Save jaime-olivares/958cc70ada481b4e2498fdb327226932 to your computer and use it in GitHub Desktop.
Regex expression for HL7 date according to http://www.hl7.eu/refactored/dtDTM.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^((?:19|20)[0-9]{2})(?:(1[0-2]|0[1-9])(?:(3[0-1]|[1-2][0-9]|0[1-9])(?:([0-1][0-9]|2[0-3])(?:([0-5][0-9])(?:([0-5][0-9](?:\.[0-9]{1,4})?)?)?)?)?)?)?([+-](?:[0-1][0-9]|2[0-3])[0-5][0-9])?$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This regex attempts to fully comply with the HL7 specification.
The pattern analyzed is: YYYY[MM[DD[HH[MM[SS[.S[S[S[S]]]]]]]]][+/-ZZZZ]