Regular expressions question

Victor Polukcht vpolukcht at gmail.com
Tue Jan 16 09:44:35 EST 2007


The same regular expression should work for another string (with *200).

On Jan 16, 5:40 pm, Neil Cerutti <horp... at yahoo.com> wrote:
> On 2007-01-16, Victor Polukcht <vpoluk... at gmail.com> 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'
>
> --
> Neil Cerutti
> We're not afraid of challenges. It's like we always say: If you want to go out
> in the rain, be prepared to get burned. --Brazillian soccer player




More information about the Python-list mailing list