regex / capture / boundary / replacement
Separate regex capture, boundaries, greedy matches and replacement risk
Separate the full match from capture groups, then review boundaries, greedy behavior, no-match and replacement risk. User input is never executed; use synthetic cases only.
Five review axes
Separate full match, capture groups, boundaries, greedy quantifiers and replacement before changing real text.
full match ≠ capture group / boundary → greedy → replacement
| Axis | Review |
|---|
| group | Separate the full match from capture numbers. |
| boundary | Check that adjacent characters are not consumed. |
| greedy | Check whether the longest match is too broad. |
| no-match | Do not treat a non-match as success. |
| replacement | Review capture-to-target mapping before execution. |
Safe correction order
- Record the full match with a synthetic input.
- Separate capture groups and boundaries.
- Review greedy behavior and no-match.
- Review replacement risk before returning to real data.
This page never executes user input or real data. Apply a real replacement only after note approval in the existing tool.
Six synthetic cases
| case | result |
|---|
group-capture | Capture group |
boundary-missing | Boundary required |
greedy-overmatch | Greedy overmatch |
no-match | No match |
replacement-risk | Replacement risk |
unsupported-user-text | Reject |