I am trying to combine an occurrence with a regex:
to (. *?) CITY [\ d]
against
John from beautiful CITY1 in sdfsf to dsfs in sf to abc CITY2 to CITY3 for 3 days
I get two matches:
to dsfs in sf to abc CITY2
to CITY3
My problem is that I need a regular exp, for which I could get a match as "for abc CITY2" instead of "to dsfs in sf for abc CITY2".
I read about lazy quantifiers, but couldn't apply it in this scenario.
source
share