Created
March 29, 2017 07:21
-
-
Save trotzig/60cf384210e24b3287a9ae14aaca86f9 to your computer and use it in GitHub Desktop.
This file contains 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 REGEX_CONST_LET_VAR = XRegExp(` | |
\A | |
(?<declaration_keyword>const|let|var)\s+ # <declaration_keyword> | |
(?<assignment>.+?) # <assignment> variable assignment | |
\s*=\s* | |
(?<import_function>\w+?)\( # <import_function> variable assignment | |
(?<quote>'|\") # <quote> opening quote | |
(?<path>[^\\2\n]+) # <path> module path | |
\k<quote> # closing quote | |
\);? | |
\s* | |
\Z | |
`, 'xs' // free-spacing, dot-match-all | |
+); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment