Last active
July 10, 2021 07:51
-
-
Save Nixinova/b6959351d57e67335657908440e3f777 to your computer and use it in GitHub Desktop.
Convert regex free-spacing mode (`(?x)`) to normal regex
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
function flatten(str) { | |
return str.replace(/\r?\n|^\s+|\s+#\s.+$/gm, '').replace('(?x)', '') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment