Reputation: 1600
The text is -"http://en.wikipedia.org/wiki/"The_Above_Ground_Sound"_of_Jake_Holmes":hey
. I need regex to get http://en.wikipedia.org/wiki/"The_Above_Ground_Sound"_of_Jake_Holmes
. I tried to write \"(.*?)\"
but failed since the inverted commas are nested. I need to get last occurrence of " at last ending part.
I think I need negative look ahead solution but not sure.
Upvotes: 1
Views: 2191
Reputation: 6272
Actually what the OP needs based on his request is:
(?<=").*(?=")
# match only the contents without the external double quotes "..." ->
# http://en.wikipedia.org/wiki/"The_Above_Ground_Sound"_of_Jake_Holmes
Upvotes: 3
Reputation: 76
"(.*)"
This grabs everything between two double quotation marks and it grabs in a greedy fashion. This means that it will try and match as much text as possible between the two quotation marks.
Upvotes: 6