in reply to Is Group Substitution Possible?

There's also Regexp::Optimizer.

the lowliest monk