Next Regular Expression Mastery 64

Disaster Continues

/^(\w+|::)*$/

     perl -Mre=debug -e '"abcd!" =~ /^(?:\w+|::)*$/'
     perl -Mre=debug -e '"abcde!" =~ /^(?:\w+|::)*$/'

takes twice as long and generates twice as much: 535 lines. We would expect

     perl -Mre=debug -e '"what_an_incredible_disaster!" =~ /^(?:\w+|::)*$/'

to take about 8,388,608 times as long and to generate 2,147,483,671 lines of output.



Next Copyright © 2002 M. J. Dominus