>> re.split(':|;|px', "width:150px;height:50px;float:right") > >You could recognize that the delimiter you want to strip is in fact px; >and not px in and of itself. > >So, try: > >re.split(':|px;', "width:150px;height:50px;float:right") > >Emile
That won't work at all outside of the example case. It'd choke on any attribute seperator that didn't end in px. Honestly I'd recommend recovering the size measurement anyway, since there are pretty huge differences between each form of measurement in CSS. Seperating it from the number itself is fine and all since you probably still need to turn it into a number Python can use, but I wouldn't discard it outright. ~Temia -- When on earth, do as the earthlings do. -- http://mail.python.org/mailman/listinfo/python-list