I am trying to match an occurrence with the 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 want a regular exp using which I could get a match as "to abc CITY2" instead of "to dsfs in sf to abc CITY2".
I read about lazy quantifiers but couldn't apply it in this scenario.