正则表达式截取两个指定字符串之间的内容?

2024-11-16 13:27:54
推荐回答(2个)
回答1:

正则表达式 "value":\["(.*?)"\]

然后取第一个分组就好了,加个?是懒惰匹配,尽量匹配少的字符

回答2:

这段字符串,需要提取 "MEMBERID":"24912496","SHOPTYPE" 中间的数字 24912496

两个特定字符串带有符号的;例如PROMOTEDTYPE":"260","MEMBERID":"24912496","SHOPTYPE":"2","EXLEVEL":"15","PROMOTEDTYPE":"260","MEMBERID":"78912496","SHOPTYPE":"2","EXLEVEL":"15","PROMOTEDTYPE":"260","EXMEMBERID":"28912496","SHOPTYPE":"2","EXLEVEL":"15","PROMOTEDTYPE":"260","MEMBERID":"74122906","SHOPTYPE":"2","EXLEVEL":"15"。