On 2007-01-16, Victor Polukcht <[EMAIL PROTECTED]> wrote: > On Jan 16, 5:40 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: >> On 2007-01-16, Victor Polukcht <[EMAIL PROTECTED]> wrote: >> >> > Actually, i'm trying to get the values of first field (Global) , fourth >> > (200, 4), and fifth (100%) and sixth (100%). >> >> > Everything except fourth is simple. >> >>> g = "Global etsi3 * 4 ok 30 100% 100% Outgoing" >> >>> import re >> >>> r = re.search('\*\s+(\d+)', g) >> >>> r.group() >> '* 4' >> >>> r.group(1)'4' > > The same regular expression should work for another string (with *200).
Sorry about that. It should have been: r = re.search('\*\s*(\d+)', g) -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list