I first thought that this answer will totaly solve my issue, but it did not.
I have a string url like this one:
http://www.someurl.com/some-text-1-0-1-0-some-other-text.htm#id_76
I would like to extract some-other-text
so basically, I come with the following regex:
/0-(.*)\.htm/
Unfortunately, this matches 1-0-some-other-text
because regex are greedy. I can not succeed make it nongreedy using .*?
, it just does not change anything as you can see here.
I also tried with the U
modifier but it did not help.
Why the "nongreedy" tip does not work?