Regular expressions question

Victor Polukcht vpolukcht at gmail.com
Tue Jan 16 15:22:42 CET 2007


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.

On Jan 16, 2:59 pm, Duncan Booth <duncan.bo... at invalid.invalid> wrote:
> "Victor Polukcht" <vpoluk... at gmail.com> wrote:
> > I have 2 strings:
>
> > "Global               etsi3   *200 ok            30   100% 100%
> > Outgoing"
> > and
> > "Global               etsi3   *   4 ok             30   100% 100%
> > Outgoing"
>
> > The difference is "*200" instead of "*  4". Is there ability to write a
> > regular expression that will match both of that strings?Yes, ".*" would match both of the strings, but not in a useful way. You'll
> have to consider which strings you *don't* want to match as well as which
> ones you do and whether you want to extract any information from the
> strings or find the ones which match.
>
> But first take a step back and look at the problem as a whole. You didn't
> say what you are trying to do, and often people will jump at regular
> expressions as the solution when there may be better ways of doing what
> they want without writing a regular expression.
> 
> What do you really want to do?




More information about the Python-list mailing list