See my answer to dragonchild for why. I'm sorry, I thought everybody knew about
sexeger, which was probably a pretty foolish assumption. Here are a couple of regexes I've run through my program:
Before: (?i-msx:a(ab)(cd)\2\1)
After: (?i-msx:(ba)(dc)\2\1a)
Before: (?-imsx:\d+[abc]def(foo|bar))
After: (?-imsx:(oof|rab)fed[abc]\d+)
Note that the 2nd is from
japhy's seminal work on the subject, and differs from his reversal: alternatives should maintain their order (
foo|bar becomes
oof|rab, not
rab|oof).
Caution: Contents may have been coded under pressure.