Skip to content

Instantly share code, notes, and snippets.

@DmitrySoshnikov
Created April 24, 2017 23:35
Show Gist options
  • Save DmitrySoshnikov/af0b126e92845480cb2b5cc9f0d3e9d5 to your computer and use it in GitHub Desktop.
Save DmitrySoshnikov/af0b126e92845480cb2b5cc9f0d3e9d5 to your computer and use it in GitHub Desktop.
regexp-x-flag-re.js
// 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