Created
September 1, 2011 15:55
-
-
Save capnslipp/1186489 to your computer and use it in GitHub Desktop.
RegExp'ing in JSON
This file contains hidden or 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
var endOfScopeMarker = '\t\t},'; | |
var find = new RegExp('"someProperty" : 3((?:(?!'+endOfScopeMarker+').|\n)+)("anotherPropertyWithinTheSameScope" : 1,)', "g"); | |
var replace: '"someProperty" : 0$1$2'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment