http://qs321.pair.com?node_id=372064


in reply to How will my regular expression match?

Hey, hv....

I think this a great short explanation of regex engine expectations. The only part I might tweak is the part that addresses the mostly greedy nature of the Perl engine.

Your explanation is right on with regards to the way the engine behaves. You may, however, want to change the term iterations to something else. Iterations usually refers to the repetition of a series of operations. So, while the process of attempting to match against each character could be called an iteration of the regex engine, the characters could really not.

I'm not trying to be overly critical or anything. This tutorial would be great for new (Perl|regex) users to read and i guess I just think the use of iterations might be a bit confusing to them.


dsb
This is my cool %SIG
  • Comment on Re: How will my regular expression match?

Replies are listed 'Best First'.
Re^2: How will my regular expression match?
by hv (Prior) on Jul 06, 2004 at 13:00 UTC
    Iterations usually refers to the repetition of a series of operations.

    Hmm, I was thinking of the process of matching "the thing quantified" once as the series of operations being repeated. But I don't have a good name for "the thing quantified". I agree that 'iterations' isn't ideal, but I'm not sure what would be better.

    I'm not trying to be overly critical or anything.

    Please, do be. :)

    Hugo

      I don't have a good name for "the thing quantified".
      I suggest "repetitions".

      We're not really tightening our belts, it just feels that way because we're getting fatter.
        Or perhaps "instances".