TIL that while PCRE has conditional subpatterns ((?(expr1)expr2), which tries to match expr2 only if expr1 matches), it also has a built-in ?(DEFINE) condition that always fails to match (unless you've named a subpattern DEFINE somewhere).
Sounds useless? With it you have a place to stuff named subpatterns for later re-use without having to have them match something in your string; in the "real" pattern you can then refer to a subpattern by name without having to clutter up the expression by its definition.
From the pcre documentation:
/ (?(DEFINE) (?<byte> 2[0-4]\d | 25[0-5] | 1\d\d | [1-9]?\d) )
\b (?&byte) (\.(?&byte)){3} \b
/x
That matches ipv4 address dot-quads. The "real" pattern is the bit between the \b boundaries; the first line doesn't match anything but creates the byte subpattern that gets used later.
Basically we're talking subexpressions as macros.
This is going to make this parser I'm writing here a lot more legible...