Created
February 16, 2023 13:58
-
-
Save wilnaweb/9ed539b25b7dd0bdae1de473cef74cc3 to your computer and use it in GitHub Desktop.
RegExp search JSON by key within prefix
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 regexp = /(?:\"PRE-)(.*?)(?:\":)(?:\")(.*?)(?:\")/gi; | |
var json = '{ | |
"KEY 1":"VALUE", | |
"KEY 2":"VALUE", | |
"PRE-KEY3":"VALUE", | |
"KEY 10":"VALUE", | |
"PRE-KEY4":"TEST" | |
}'; | |
// Example: https://regexr.com/78d0r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment