Replace QRegularExpression with SamRegex (src/sam/samregex.{h,cpp}), a
faithful port of plan9port src/cmd/sam/regexp.c: a Thompson/Pike NFA.
- Leftmost-LONGEST (POSIX): matches real sam exactly, including overlapping
alternation (a|ab on 'ab' -> 'ab'), eliminating the one remaining
greedy-vs-longest divergence from PCRE.
- Linear time, no backtracking: immune to catastrophic blowup ((a*)*b over
10k 'a' returns instantly).
- sam dialect only: . * + ? | ( ) [ ] ^ $ and \ escaping (\n = newline);
^/$ per-line and ./negated-classes exclude newline, all intrinsic. No
PCRE extras (\d \w \b, lookaround, non-greedy) — sam never had them.
Port notes: shunting-yard compiler + Pike VM with per-thread capture sets and
leftmost-longest newmatch(). Fixed two porting bugs vs the C original: the
l-union aliasing of OR's left/continuation with .next, and reading the popped
subid during popator for correct capture-group ids.
SamEngine now compiles/matches via SamRegex (search, s, x/y/g/v, replacement
captures). Tests: new test_samregex (18) + updated test_samengine (31, incl.
leftmostLongestSubstitution, sam-dialect capture groups). 18/18 ctest suites.
Docs: rewrite docs/SAM.md (no more PCRE deviation; dialect + semantics are
sam's), update PLAN.md and the panel hint.