we (web engine): Experimental web browser project to understand the limits of Claude

JS Built-in: RegExp engine #271

Open pierrelf.com
targeting main
Open opened by and assigned to pierrelf.com
targeting main

Implements issue 3mhn3o5n5fm2l — JS Built-in: RegExp engine.

Summary #

  • Regex engine (regex.rs): From-scratch regex parser and backtracking matcher supporting character classes, quantifiers (greedy/lazy), anchors, capturing/non-capturing/named groups, alternation, backreferences, lookahead, and escape sequences
  • RegExp built-in: Constructor, prototype methods (test, exec, toString), all flags (g/i/m/s/u/y), lastIndex tracking, named capture groups
  • Compiler: RegExp literals (/pattern/flags) now compile to RegExp(pattern, flags) calls
  • String integration: Added match, matchAll, search; updated replace, replaceAll, split to handle RegExp with $-substitution support

Test plan #

  • 25 regex engine unit tests (parser, matcher, flags)
  • 23 VM integration tests (constructor, literals, exec, test, toString, string methods, flags, quantifiers, alternation, lookahead, char classes, backreferences)
  • All 412 JS tests pass, full workspace tests pass
  • cargo clippy --workspace -- -D warnings clean
  • cargo fmt --all --check clean

This pull request has no versions submitted yet.