Created
July 11, 2021 01:16
-
-
Save selfagency/774d95b2be89ffa18e897230848a871f to your computer and use it in GitHub Desktop.
find iso date regex
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
| const str = DATE_STRING | |
| const isoDate = /(Sun\w*\.?|Mon\w*\.?|Tue\w*\.?|Wed\w*\.?|Thu\w*\.?|Fri\w*\.?|Sat\w*\.?)?\ ?(Jan\w*\.?|Feb\w*\.?|Mar\w*\.?|Apr\w*\.?|May\w*\.?|Jun\w*\.?|Jul\w*\.?|Aug\w*\.?|Sep\w*\.?|Oct\w*\.?|Nov\w*\.?|Dec\w*\.?)\ ?(\d+)?,? \ ?(\d{1,2}:\d{1,2}:?\d{2}?\ ?\w{3}\ ?)?(\d{4})/.exec(str) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment