Jump to content
Sign in to follow this  
mrflibblehat

StringRegExp Escaping

Recommended Posts

mrflibblehat

Hi All,

Having a small problem trying to get some data from a JSON Music API

The Pattern needs to include the following but I am not sure how to escape it. I have tried using but to no avail. if someone who knows regex better than me can have a look that would be much appreciated.

Example Data

{
"results": {
    "tagmatches": {
      "tag": [{
        "name": "disco",
        "count": "55483",
        "url": "www.last.fm\/tag\/disco"
      },
      ...
      {
        "name": "disco pop",
        "count": "160",
        "url": "www.last.fm\/tag\/disco%20pop"
      }]
    },
    "for": "disco"
  }
}

for example I want "name": as the pattern and disco pop as the result.

My attempted pattern so far is

"\""tag""\""\:"(.*?)"

Thanks for any help


[font="'courier new', courier, monospace;"]Pastebin UDF | Prowl UDF[/font]

Share this post


Link to post
Share on other sites
mrflibblehat

Managed to sort it :)

'"name": "(.*?)"'
Edited by mrflibblehat

[font="'courier new', courier, monospace;"]Pastebin UDF | Prowl UDF[/font]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×