in reply to Re: Re: Infinite loop regex
in thread Infinite loop regex

Think about it this way... every time you call the method on your object, it's basically like calling a subroutine which returns a string (because it does). However, because you're calling that method while the regex matches, it starts anew each time...

You: Ok, run the method.
Regex: Wow, here's match #1... return $1
You: print(); Ok, run the method...
Regex: Wow, here's match #1... return $1


Wash, rinse, repeat...

Make sense?

-fp

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.