java - Extracting a pattern from String -
i have random string need match pattern , parse out.
my string-
{"sid":"zw9cmv1pzybexi","parentid":null,"time":1373271966311,"color":"#e94d57","userid":"255863","st":"comment","type":"section","ctype":"parent"},{},null,null,null,null,{"sid":"zwldv1lx4f7ovx","parentid":"zw9cmv1pzybexi","time":1373347545798,"color":"#774697","userid":"5216907","st":"comment","type":"section","ctype":"child"},{},null,null,null,null,null,{"sid":"zw76w68c91mhbs","parentid":"zw9cmv1pzybexi","time":1373356224065,"color":"#774697","userid":"5216907","st":"comment","type":"section","ctype":"child"},
from above want parse out (using regex) values userid attribute. can me out on how ? random string , not json. can provide me regex solution ?
is random string ? looks json me, , if recommend json parser in preference regexp. right thing when faced particular language/grammar use corresponding parser, rather (potentially) fragile regexp.
Comments
Post a Comment