Created
September 1, 2017 14:41
-
-
Save xyfeng/4fd9ee358b029a1ae94764c1f61e09f8 to your computer and use it in GitHub Desktop.
regex/js/comment
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
/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm | |
// JavaScript: | |
// source_string.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm, '$1'); | |
// PHP: | |
// preg_replace("/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/m", "$1", $source_string); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment