Hello Peter And NG, thank you a lot... now I'm blaming myself, how couldn't I see it? I will probably go for the re.sub (if it is not too complicated, I'm not a Python expert and even less expert of RegEx things), if not I'll try your suggestion of sorting the strings by length.
Thanks a lot. Andrea. ------------------------------------------------------------------------------------------------------------------------------------------ Message for the recipient only, if received in error, please notify the sender and read http://www.eni.it/disclaimer/ -- http://mail.python.org/mailman/listinfo/python-list