in reply to Regular expression

No one really told you why you query for the last number failed, but Masem sorta did... the reason it failed was that \d.\d matches one number, then any one character, then one number... as Masem said, you need to use \. in order to escape . to match . instead of one of any character, but you also needed \d* or \d+ after the \. to match more than one number. You were only matching the 5 after the . instead of 509667... so the regex couldn't match the E
                - Ant

Replies are listed 'Best First'.
Re: Re: Regular expression
by Anonymous Monk on May 01, 2001 at 18:17 UTC
    So what if there is a '-' in front of the data in the last column:
    /^(\d+) (\d\d:\d\d:\d\d) (\d\d-\w+-\d{4}) (\d+) (\d+\s+\d+) ([-]\d+\. +\d+E[-+]\d+)/; It don't work...
      -? allows for one or no -

      ? is one or none, * is zero or more, + is 1 or more
                      - Ant