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


in reply to Regexp::Assemble hangs with a certain case

Run this

perl -Mre=debug -le " 1 while q{234} =~ /\d/g "

Compare with one or two pages from this infinite loop

perl -Mre=debug -le " 1 while q{234} =~ /\d/ "

You should notice that without g in m//g the pos-ition doesn't advance, you're always matching against 2, and its always true, and it never ends, cause 2 is always \d

Regexp::Assemble hangs with a certain case

A regex produced by Regexp::Assemble is not Regexp::Assemble , Regexp::Assemble is not hanging -- but you're not even using Regexp::Assemble to assemble a regex, so its got nothing to do with it