0

嗨,我是正则表达式的新手,我需要提取这个字符串:

{"Name":"John","Tagline":"Hi","Title":"Developer","Company":"Iconnexus","Industry":"Comp","What I Do":"Android","Who do I want to meet":"Android Developers","WHOOZNEAR_PROFILEPIC":"content://media/external/images/media/4"}

从这个:

{"nameValues":{"Name":"John","Tagline":"Hi","Title":"Developer","Company":"Iconnexus","Industry":"Comp","What I Do":"Android","Who do I want to meet":"Android Developers","WHOOZNEAR_PROFILEPIC":"content://media/external/images/media/4"},"profileId":1,"valid":false}

我将使用什么正则表达式来获取该字符串?

4

2 回答 2

4

不要使用正则表达式,使用 JSON 解析器

于 2012-08-09T01:18:35.250 回答
0

或者,如果您真的想使用正则表达式来提取该部分: ^{"nameValues":(.*)$并使用第一个捕获组。

于 2012-08-09T02:04:28.840 回答