diff --git a/README.md b/README.md index 4b97ca2..b89b9ba 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,10 @@ Using default `accuracy` adds support for the following features, depending on ` *Default: `false`.* -Disables advanced emulation that relies on returning a `RegExp` subclass, resulting in certain patterns not being emulatable. +Disables advanced emulation that relies on returning a `RegExp` subclass. In cases when a subclass would otherwise have been used, this results in one of the following: + +- An error is thrown for certain patterns that are not emulatable without a subclass. +- When the regex can still be emulated accurately, *subpattern* match details (accessed via properties of match objects returned when using the regex) might differ from Oniguruma. ### `flags` diff --git a/package.json b/package.json index 4913c50..2c6b722 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oniguruma-to-es", - "version": "0.8.0", + "version": "0.8.1", "description": "Convert Oniguruma patterns to native JavaScript RegExp", "author": "Steven Levithan", "license": "MIT", diff --git a/scripts/utils.js b/scripts/utils.js index 65484c3..c153c5e 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -116,6 +116,7 @@ async function onigurumaExec(pattern, str, pos = 0) { return null; } + // Uncomment to see subpattern match details // for (const obj of match.captureIndices) { // obj.match = str.slice(obj.start, obj.end); // }