Created
April 24, 2017 23:30
-
-
Save DmitrySoshnikov/e6d649e2d1381fecbbe24cca50261ac9 to your computer and use it in GitHub Desktop.
regexp-x-flag.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 `RegExp`: | |
new RegExp(` | |
# 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