Simple regexp problem

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


Shane Hoversten <srh232 at nyu.edu> 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?

Cheers,
M.

-- 
  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