What it does
A regex alternation returns the FIRST branch that matches, not the longest, so an earlier alternative that is a prefix of a later one truncates the match.
How it helps you
Text matching picks the full match rather than a shorter one.
Tested against itself
6 deliberate breaks, all caught
We change this check on purpose and watch its test fail. Each dot is one of those changes.
Details
| Category | Code quality |
|---|---|
| Also filed under | Test quality |
| Checks in this category | 216 |
| ISO/IEC 25010 | Maintainability: modifiability |
| Breaks caught | 6 |