how to express the following regular expression?

Stephen fungho at sinaman.com
Wed Nov 21 04:43:44 EST 2001


I want to search the following formats:

([1234567890]*)R

or 

P([1234567890]*)

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?([1234567890]*)R?
because the number without P and R is also matched! 

How can I express it?

thx!

Stephen



More information about the Python-list mailing list