The other thing you can do is take the assembled expression, remove the ?: to turn it into a POSIX-compatible expression, and feed that to egrep.
Except that makes zero difference because egrep uses a DFA engine (as opposed to Perl's NFA.) To a DFA engine it doesn't matter which of any number of equivalent regexen you use. So long as they all match the exact same things, all of them will be translated to the exact same state machine.
Makeshifts last the longest.
In reply to Re^2: perl performance vs egrep
by Aristotle
in thread perl performance vs egrep
by dba
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |