user268397
user268397

Reputation: 1927

Java Regex String

Hi, I'm new to regular expressions and I need to extract this string:

{"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"}

from this one:

{"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}

What regular expression would I use to get that string?

Upvotes: 0

Views: 100

Answers (2)

Michael
Michael

Reputation: 1012

Or if you're really wanting to use regex to extract that part: ^{"nameValues":(.*)$ and use the first capture group.

Upvotes: 0

Thilo
Thilo

Reputation: 262464

Don't use regular expressions, use a JSON parser.

Upvotes: 4

Related Questions