Mailing List Archive

Regular Expression bug?
Greetings.

For the RegExp Gurus, consider the following python3 code:
<code>
import re
s = "pn=align upgrade sd=2023-02-"
ro = re.compile(r"pn=(.+) ")
r0=ro.match(s)
>>> print(r0.group(1))
align upgrade
</code>

This is wrong. It should be 'align' because the group only goes up-to
the space. Thoughts? Thanks.

josé

--

What if eternity is real? Where will you spend it? Hmmmm...
--
https://mail.python.org/mailman/listinfo/python-list