I'm trying to match all values from any json. My regex right now is /: ('|").*?('|")(?=,)?/g
I need to get only value with qoutes, but getting colon also. https://www.regextester.com/99141 Any tips?
Took some doing, but I think this seems to pass the tests I've thrown at it :
/("[^"\\]*(?:\\.[^"\\]*)*")(?=,|\s*(]|}))/g
It appears workable on both minified and prettified JSON strings.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.