
On Jan 5, 2007, at 9:38 , Jules Bean wrote:
Yitzchak Gale wrote:
You need to use a more sophisticated algorithm - building up trees of potential matches, backtracking in some cases, etc. Why re-invent the wheel? Just use the regex library, where that is already done.
It's merely a question of selecting the right wheel. Some problems are so simple that regexes are overkill. Some problems are so complex that regexes are insufficient. Some problems generate extraordinarily ugly regexes, which are then hard-to-debug.
I will note that the most common use for regexes in Perl is for parsing (which is why perl6 has generalized regexes into a parsing mechanism). -- brandon s. allbery [linux,solaris,freebsd,perl] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH