0

As you can see in the "Debuggex Demo" it's only matching "Drama", but I also want "Foreign", but I can't get it working. Anyone could give me a hand?

Thanks in advance.

name":"(.*?)"}.*?,"homepage

Regular expression visualization

Debuggex Demo

2
  • It looks like JSON; why would you need regex to parse it? Commented Dec 5, 2013 at 22:38
  • In this "project" I'm forbidden to use any JSON library or something like that. Commented Dec 5, 2013 at 22:40

2 Answers 2

4

You can use positive look-ahead and change it to:

name":"(.*?)"}.*?,(?=.*"homepage)

EDIT: As pointed out by Pshemo, even shorter one works too

name":"(.*?)"}(?=.*"homepage)
Sign up to request clarification or add additional context in comments.

1 Comment

Hum... I didn't know about it. I'll read how it works now. Anyway, your regex is totally working, thanks!
1

You can use:

(?=name":"(.*?)".*,"homepage)

Comments

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.