im Beispiel gibt match "23456" aus - also reluctant/non-greedy
die Doku sagt {min,max} sei greedy während {min,max}? non-greedy sei
http://docs.python.org/library/re.html# ... ion-syntax
in diesem Beispiel funktioniert das leider nicht:
Code: Alles auswählen
import re
str="a string with numbers 123456 for regex"
c56 = re.compile(r".*(\d{5,6}).*")
print ("{5,6} is supposed 2 b greedy", c56.match(str).group(1))
c6 = re.compile(r".*(\d{6}).*")
print (c6.match(str).group(1))
Habe ich vielleicht etwas falsch gemacht?
Handelt es sich um einen Bug?