how to express the following regular expression?
fungho at sinaman.com
Thu Nov 22 03:31:51 CET 2001
Thank you very much!
"Carl Howells" <chowells at cs.uoregon.edu> wrote in message news:<9tft7a$30$1 at helix.cs.uoregon.edu>...
> "Stephen" <fungho at sinaman.com> wrote...
> > I want to search the following formats:
> > (*)R
> > or
> > P(*)
> > this means there must be a 'P' before the number or a 'R' after the
> > number. However, I think I can't use this:
> > P?(*)R?
> > because the number without P and R is also matched!
> > How can I express it?
> Exactly you you'd expect... One or the other:
> You could also use [0-9] in place of \d, if you were really set on using the
>  notation. But there's no reason to use .
More information about the Python-list