Simple regexp problem
Chris Dutton
chris at cmb-enterprises.com
Mon Feb 25 14:53:01 EST 2002
In <ueljelpvz.fsf at python.net> Michael Hudson <mwh at python.net> wrote:
>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")
Or better yet:
re.sub("^1+", "", "11111junk")
More information about the Python-list
mailing list