Can a regular expression match whitespace or the start of a string?
I\'m trying to replace currency the abbreviation GBP with a £ symbol. I
Yes, why not?
re.sub(u'^\W*GBP...
matches the start of the string, 0 or more whitespaces, then GBP...
edit: Oh, I think you want alternation, use the |:
|
re.sub(u'(^|\W)GBP...