Created
July 13, 2015 18:24
-
-
Save AbraaoAlves/6d0ab36b06c3690f851d to your computer and use it in GitHub Desktop.
replace value with regex
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 reg = /"IPhone 6": .+;/g; | |
| var str = '{asdasdasd; "IPhone 6": weqweq; "asdasda":"asdasdas"}' | |
| str.match(reg) | |
| //[""IPhone 6": weqweq;"] | |
| var resul = str.match(reg)[0].replace("\"IPhone 6\":", "").replace(";", "") | |
| resul | |
| //" weqweq" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment