/ABC(?:DD.|D.D|.DD).E/; # Add /s if newline is acceptable near the +Ds
As for the generic case, you don't. Regexes aren't suitable for that. For particular cases, you may be able to get away with listing all possibilities, or by using (?{...}), but in a general case, you'd be using the wrong tool.
In reply to Re: regexp with mismatches
by JavaFan
in thread regexp with mismatches
by jrblas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |