Sep-16-2017, 03:56 PM
Hi,
I am trying to achieve a non-greedy Regex match.
I am writing
I was expecting it to give hahahaman because I have put ? for non greedy match
I am trying to achieve a non-greedy Regex match.
I am writing
n = re.compile(r'(ha){3,5}?man') mo = n.search('hahahahahaman') mo.group()but I don't understand why mo.group() gives hahahahahaman.
I was expecting it to give hahahaman because I have put ? for non greedy match