regex - Regular Expression to extract string from JSON response -


i trying extract value timezoneid regexr says no match.

here json code:

{   "dstoffset": 0,   "rawoffset": 25200,   "status": "ok",   "timezoneid": "asia/jakarta",   "timezonename": "western indonesia time" } 

and when test on regexplanet says illegal repetition {\s*"timezoneid"\s*:\s*(.+?)\s*\}

can , explain i'm doing wrong.

update

i parsing result in while loop, need regex line when match "timezoneid": "asia/jakarta", want grab out asia/jakarta.

thanks

g

the { , } brackets special characters in regex , need escaped. see more here: patternsyntaxexception: illegal repetition when using regex in java

also, dustmouse said, requiring {} around timezoneid there isn't whitespace between { , "timezoneid". other fields there causing not match.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -