From 06c9d8546c71dd5d6216f5699a2f83635423c7eb Mon Sep 17 00:00:00 2001 From: Steven Levithan Date: Fri, 20 Dec 2024 04:06:43 +0100 Subject: [PATCH] Tweaks --- README.md | 4 ++-- scripts/utils.js | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dc68357..4b97ca2 100644 --- a/README.md +++ b/README.md @@ -948,11 +948,11 @@ The following don't yet have any support, and throw errors. They're all infreque - Flags `P` (POSIX is ASCII) and `y{g}`/`y{w}` (grapheme boundary modes). - Rarely-used character specifiers: Non-A-Za-z with `\cx`, `\C-x`; meta `\M-x`, `\M-\C-x`; bracketed octals `\o{…}`; octal UTF-8 encoded bytes (≥ `\200`). - Code point sequences: `\x{H H …}`, `\o{O O …}`. - - Whole-pattern modifiers: Don't capture `(?C)`, ignore-case is ASCII `(?I)`. + - Whole-pattern modifier: Don't capture `(?C)`. - Supportable for some uses: - Absence functions: `(?~…)`, etc. - Conditionals: `(?(…)…)`, etc. - - Whole-pattern modifier: Find longest `(?L)`. + - Whole-pattern modifiers: Ignore-case is ASCII `(?I)`, find longest `(?L)`. - Not supportable: - Callout functions: `(?{…})`, etc. diff --git a/scripts/utils.js b/scripts/utils.js index 6e99b0f..65484c3 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -115,6 +115,12 @@ async function onigurumaExec(pattern, str, pos = 0) { if (!match) { return null; } + + // for (const obj of match.captureIndices) { + // obj.match = str.slice(obj.start, obj.end); + // } + // console.log(match); + const m = match.captureIndices[0]; return { '0': str.slice(m.start, m.end),