0

I have a string that look like this

BLA BLA BLA "url_encoded_fmt_stream_map": "ABCDEFGHIJKLMN" BLA BLA BLA BLA

And i want to get the string ABCDEFGHIJKLMN,i tried to do it with REGX:

html = html.match("\"url_encoded_fmt_stream_map\": \"(.*)\"");

But it always give me an empty string.Any idea what is the problem with this method?

1
  • A regex is an object with a special literal syntax, it is not a string, a regex is enclosed in /regex/ Commented Jul 3, 2013 at 8:30

1 Answer 1

2

Try it without the quotes:

html = html.match(/"url_encoded_fmt_stream_map\": \"(.*)"/);

the slashes tell javascript it is a regular expression.

Sign up to request clarification or add additional context in comments.

1 Comment

I run this code on objective-c so i don't have stuff like this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.