On May 1, 9:50 am, deuteros <deute...@xrs.net> wrote: > I'm using regular expressions to split a string using multiple delimiters. > But if two or more of my delimiters occur next to each other in the > string, it puts an empty string in the resulting list. For example: > > re.split(':|;|px', "width:150px;height:50px;float:right") > > Results in > > ['width', '150', '', 'height', '50', '', 'float', 'right'] > > Is there any way to avoid getting '' in my list without adding px; as a > delimiter?
Are you parsing css? If so have you tried things like cssutils http://cthedot.de/cssutils/? [There are other such... And I dont know which is best...] -- http://mail.python.org/mailman/listinfo/python-list