in reply to Conditional regex

The (?(2)...) conditional turns out to be useless, because if the second set of parens don't match, then \2\1 is the same as \1, so it may as well just be \2\1 (without the conditional logic). And the (\w+)? may as well be (\w*), I think.

Update: In an earlier version of perl, the parens in (\w+)? may actually capture something even when the whole (\w+)? matches the empty string, which may be the reason for the conditional, but changing it to (\w*) would make the conditional totally unnecessary.