in reply to Regular expression and lexical variables

The regexp match operator returns true or false based on success or failure of the match. As you're seeing, it's not generally safe to assume things worked out and you got a match as you expected. When the match fails, $1, $2, and $3 aren't being re-set. It's not your lexicals, it's the fact that nothing new has been captured into $1, $2, and $3, so they retain their old value.

Is this a trick question thrown at you by a teacher to see if you're looking closely enough at the data set? It seems a little fishy that semicolons would be scattered into time stamps at different locations in each stamp.


Dave

  • Comment on Re: Regular expression and lexical variables