Last active
August 29, 2015 14:11
-
-
Save tomasgreen/227614de9a65baa42221 to your computer and use it in GitHub Desktop.
Detect trailing commas in javascript
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
We can all agree that trailing commas in IE7 is a drag. The solutions I've found invovles some kind of automatic removal which feels a little over the top. So I've decived to go the easy way. | |
This regex can be used with the find function in your text editor. So simple and within your control. | |
,(\n|\s*)+(\s*\/\/.*\n)*\s*[\}\)\]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment