On 7/6/09, Axel Schmalowsky <aschmalowsky / df.eu> wrote:
> I've got a question about ruby's regexp-engine: I'm wondering why ruby's
> regexp-engine is soo much slower than perl's.

Just guessing here, but usually when regexes are slow it's because of
backtracking. Since it looks like you don't need any backtracking in
this little script, you might try throwing in some (?> ) around your
repetitions. (And yes, perl doesn't require this hack to be fast.
Perl's probably applying it for you automatically... perl's regex is
smarter than ruby's; what can I say?) HTH