我有一个随机字符串,我需要从中匹配某个模式并将其解析出来。
我的弦——
{"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,空,{“sid”:“zw76w68c91mhbs”,“parentId”:“zw9cmv1pzybexi”,“时间”:1373356224065,“颜色”:“#774697”,"userId":"5216907" ,"st":"comment","type":"section","cType":"child"},
从上面我想解析出(使用正则表达式) userId 属性的所有值。谁能帮助我如何做到这一点?它是一个随机字符串,而不是 JSON。你能为我提供一个正则表达式解决方案吗?