Simple regexp problem

Michael Hudson mwh at
Thu Feb 21 18:10:26 CET 2002

Shane Hoversten <srh232 at> writes:

> Hi all,
> 	This question has gotta be real simple.  I want to remove
> preceeding whitespace from a string.  Seems like I should be able to
> say (using another example to make it easier to see):
> re.sub("^1", "", "11111junk")

re.sub("^1*", "", "11111junk")

Maybe you should have another look at the docs...

But you do know about .lstrip(), right?


  ARTHUR:  Don't ask me how it works or I'll start to whimper.
                   -- The Hitch-Hikers Guide to the Galaxy, Episode 11

More information about the Python-list mailing list