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
AxisReview
groupSeparate the full match from capture numbers.
boundaryCheck that adjacent characters are not consumed.
greedyCheck whether the longest match is too broad.
no-matchDo not treat a non-match as success.
replacementReview capture-to-target mapping before execution.

Safe correction order

  1. Record the full match with a synthetic input.
  2. Separate capture groups and boundaries.
  3. Review greedy behavior and no-match.
  4. 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

caseresult
group-captureCapture group
boundary-missingBoundary required
greedy-overmatchGreedy overmatch
no-matchNo match
replacement-riskReplacement risk
unsupported-user-textReject