regex - Regular Expression Match (get multiple stuff in a group) -


i have trouble working on regular expression.

here string in 1 line, , want able extract thing in swatchcolorlist, want word natural burlap, navy, red

what have tried '[(.*?)]' inside bracket, want in 1 line? possible, or need in 2 steps?

thanks

     {"id":"1349306","categoryname":"kids","imagesource":"7/optimized/8769127_fpx.tif","swatchcolorlist":[{"natural burlap":"8/optimized/8769128_fpx.tif"},{"navy":"5/optimized/8748315_fpx.tif"},{"red":"8/optimized/8748318_fpx.tif"}],"suppresscolorswatches":false,"primarycolor":"natural burlap","clickableswatch":true,"selectedcolornameid":"natural burlap","morecolors":false,"suppressproductattribute":false,"colorfamily":{"natural burlap":"ivory/cream"},"maxquantity":6} 

you can try regex

(?<=[[,]\{\")[^"]+ 

enter image description here

if negative lookbehind not supported, can use

[[,]\{"([^"]+) 

this save needed word in group 1.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -