Regular Expression bug?
jose isaias cabrera
jicman at gmail.com
Thu Mar 2 22:36:52 EST 2023
On Thu, Mar 2, 2023 at 9:56 PM Alan Bawden <alan at csail.mit.edu> wrote:
>
> jose isaias cabrera <jicman at gmail.com> writes:
>
> On Thu, Mar 2, 2023 at 2:38 PM Mats Wichmann <mats at wichmann.us> wrote:
>
> This re is a bit different than the one I am used. So, I am trying to match
> everything after 'pn=':
>
> import re
> s = "pm=jose pn=2017"
> m0 = r"pn=(.+)"
> r0 = re.compile(m0)
> s0 = r0.match(s)
> >>> print(s0)
> None
>
> Assuming that you were expecting to match "pn=2017", then you probably
> don't want the 'match' method. Read its documentation. Then read the
> documentation for the _other_ methods that a Pattern supports. Then you
> will be enlightened.
Yes. I need search. Thanks.
--
What if eternity is real? Where will you spend it? Hmmmm...
More information about the Python-list
mailing list