How to parse Json using Regex?

前端 未结 2 1383
你的背包
你的背包 2021-01-27 13:14

I want to parse this json data with regex. But, i could not. I tried like this module.getid(.*), but no working.

Only, I want to take this part -> mod

2条回答
  •  终归单人心
    2021-01-27 14:06

    Try this if you want to capture the first (demo):

    /module.getid\((.*?)\); *module.getresult(?:.*?)\);$/m
    

    If you want to capture both json strings (demo):

    /module.getid\((.*?)\); *module.getresult(.*?)\);$/m
    

提交回复
热议问题