Created
April 24, 2017 23:35
-
-
Save DmitrySoshnikov/af0b126e92845480cb2b5cc9f0d3e9d5 to your computer and use it in GitHub Desktop.
regexp-x-flag-re.js
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
// Using `x` flag with `re` shorthand | |
// Meta-chars like \d can be escaped using single slash. | |
// Plugin should specify `useRe` option. | |
re`/ | |
# A regular expression for date. | |
(?<year>\d{4})- # year part of a date | |
(?<month>\d{2})- # month part of a date | |
(?<day>\d{2}) # day part of a date | |
/x`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment