diff --git a/src/regex.js b/src/regex.js index ecb6e40..7181f0c 100644 --- a/src/regex.js +++ b/src/regex.js @@ -105,7 +105,7 @@ const regexFromTemplate = (options, template, ...substitutions) => { expression = handlePlugins(expression, opts); try { return opts.subclass ? - new RegExpSubclass(expression, opts.flags, {unmarkEmulationGroups: true}) : + new RegExpSubclass(expression, opts.flags, {useEmulationGroups: true}) : new RegExp(expression, opts.flags); } catch (err) { // Improve DX by always including the generated source in the error message. Some browsers diff --git a/src/subclass.js b/src/subclass.js index 4b77155..abf94ac 100644 --- a/src/subclass.js +++ b/src/subclass.js @@ -5,13 +5,13 @@ import {Context, replaceUnescaped} from 'regex-utilities'; @class @param {string | RegExpSubclass} expression @param {string} [flags] -@param {{unmarkEmulationGroups: boolean;}} [options] +@param {{useEmulationGroups: boolean;}} [options] */ class RegExpSubclass extends RegExp { #captureMap; constructor(expression, flags, options) { let captureMap; - if (options?.unmarkEmulationGroups) { + if (options?.useEmulationGroups) { ({expression, captureMap} = unmarkEmulationGroups(expression)); } super(expression, flags);