Regex question about \d

Gerhard Häring gh_pythonlist at gmx.de
Sun Apr 7 14:11:49 EDT 2002


Can somebody please explain this to me:

>>> print re.search(r"\d*", "asdfsfafsw 453 dfsa").group(0)

>>> print re.search(r"\d+", "asdfsfafsw 453 dfsa").group(0)
453

Why doesn't the first regex match the digits?

Gerhard
-- 
This sig powered by Python!
Außentemperatur in München: 6.4 °C      Wind: 2.5 m/s





More information about the Python-list mailing list