>>> s = 'si_pos_99_rep_1_0.ita'<br>>>> res = tuple(re.split(r'(\d+)', s))<br>>>> res<br>('si_pos_', '99', '_rep_', '1', '_', '0', '.ita')<br>

>>> <br><br><br><div class="gmail_quote">On Fri, Apr 2, 2010 at 3:42 PM, Thomas Heller <span dir="ltr"><<a href="mailto:theller@ctypes.org">theller@ctypes.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Maybe I'm just lazy, but what is the fastest way to convert a string<br>
into a tuple containing character sequences and integer numbers, like this:<br>
<br>
<br>
'si_pos_99_rep_1_0.ita'  -> ('si_pos_', 99, '_rep_', 1, '_', 0, '.ita')<br>
<br>
Thanks for ideas,<br>
Thomas<br>
<font color="#888888"><br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>