http://www.perlmonks.org?node_id=600652


in reply to Rewrite for "How to get ($1, $2, ...)?
in thread How to get ($1, $2, ...)?

Even after reading and re-reading your Update, I still don't quite get your problem.
  1. Do your patterns span multiple lines, or must each pattern match within a single line?
  2. Do your patterns always start matching at the beginning of a line, or do you sometimes pickup a pattern halfway through a line?
If the patterns can span multiple lines, when you apply the first pattern, it's may skip over text that will match the second (third, fourth...) pattern. Won't it?

Also, unless the patterns are contstrained to start matching at the beginning of a line, it sounds like you're heading for a wildly inefficient and slow routine. Or am I misunderstanding you?

throop

  • Comment on Re: Rewrite for "How to get ($1, $2, ...)?