Partition Recursive

MRAB python at mrabarnett.plus.com
Thu Dec 23 12:49:00 EST 2010


On 23/12/2010 17:26, macm wrote:
> Hi Folks
>
> I have this:
>
> url = 'http://docs.python.org/dev/library/stdtypes.html?
> highlight=partition#str.partition'
>
> So I want convert to
>
> myList =
> ['http',':','//','docs','.','python','.','org','/','dev','/','library','/','stdtypes','.','html','?','highlight','=','partition','#','str','.','partition']
>
> The reserved char are:
>
> specialMeaning = ["//",";","/", "?", ":", "@", "=" , "&","#"]
>
I would use re.findall.



More information about the Python-list mailing list