T19: WASM /pattern/flags syntax (gimsuy) #56

Open
opened 2026-03-24 22:29:00 +03:00 by NiXTheDev · 0 comments
NiXTheDev commented 2026-03-24 22:29:00 +03:00 (Migrated from github.com)

Task 19: WASM Flag Syntax

Wave: 4 (WASM API Parity)
Category: unspecified-high
Parent: Epic #37

Problem

JavaScript regex uses /pattern/flags syntax. WASM bindings should support this for JS compatibility.

What to do

  • Add lexer/parser support for /pattern/flags syntax
  • Flags: g=global, i=ignorecase, m=multiline, s=dotall, u=unicode, y=sticky
  • Expose in WASM

Acceptance Criteria

  • new JsRegex("/abc/i") matches "ABC"
  • new JsRegex("/^a/m") matches "x\na"
  • new JsRegex("/./s") matches "\n"
  • new JsRegex("/abc/gi") matches all case-insensitive
  • new JsRegex("/abc/y") sticky matching works

Files

  • ogex/src/lexer.rs — Token enum
  • ogex/src/parser.rs — pattern parsing
  • ogex/src/engine.rs — ModeFlags struct
  • ogex/src/wasm.rs — WASM bindings

Commit

feat: /pattern/flags syntax (gimsuy)

## Task 19: WASM Flag Syntax **Wave**: 4 (WASM API Parity) **Category**: unspecified-high **Parent**: Epic #37 ### Problem JavaScript regex uses /pattern/flags syntax. WASM bindings should support this for JS compatibility. ### What to do - Add lexer/parser support for /pattern/flags syntax - Flags: g=global, i=ignorecase, m=multiline, s=dotall, u=unicode, y=sticky - Expose in WASM ### Acceptance Criteria - [ ] new JsRegex("/abc/i") matches "ABC" - [ ] new JsRegex("/^a/m") matches "x\na" - [ ] new JsRegex("/./s") matches "\n" - [ ] new JsRegex("/abc/gi") matches all case-insensitive - [ ] new JsRegex("/abc/y") sticky matching works ### Files - `ogex/src/lexer.rs` — Token enum - `ogex/src/parser.rs` — pattern parsing - `ogex/src/engine.rs` — ModeFlags struct - `ogex/src/wasm.rs` — WASM bindings ### Commit `feat: /pattern/flags syntax (gimsuy)`
Sign in to join this conversation.
No description provided.