Package Exports
- regexp-support
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (regexp-support) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
regexp-support
check RegExp ( regular expressions ) support
install
npm install regexp-support
Api
allow u check support on other RegExp base class
hasSupportFlag(flag: string, RegExpClass?: typeof RegExp, skipPatternCheck?: boolean): boolean
testFlag(flag: string, RegExpClass?: typeof RegExp, flagsPattern?): boolean
RegExpClass
can be Object with create
, for some class can't create by new
export interface ICreateRegExp
{
create(pattern: string, flag?: string, ...argv)
}
demo
import support from 'regexp-support';
console.log(support);
node.js 10
{ flags:
{ multiline: true,
m: true,
global: true,
g: true,
ignoreCase: true,
i: true,
sticky: true,
y: true,
unicode: true,
u: true,
dotAll: true,
s: true,
freeSpacing: false,
x: false,
n: false },
flagsAll: { g: true, i: true, m: true, s: true, u: true, y: true },
pattern:
{ namedCapturingGroups: true,
namedCapturingGroupsUnicode: true,
namedCapturingGroupsEmoji: false } }
node.js 9
by test on RunKit
{ flags:
{ multiline: true,
m: true,
global: true,
g: true,
ignoreCase: true,
i: true,
sticky: true,
y: true,
unicode: true,
u: true,
dotAll: true,
s: true,
freeSpacing: false,
x: false,
n: false },
flagsAll: { g: true, i: true, m: true, s: true, u: true, y: true },
pattern:
{ namedCapturingGroups: false,
namedCapturingGroupsUnicode: false,
namedCapturingGroupsEmoji: false } }
node.js 8
by test on RunKit
{ flags:
{ multiline: true,
m: true,
global: true,
g: true,
ignoreCase: true,
i: true,
sticky: true,
y: true,
unicode: true,
u: true,
dotAll: true,
s: true,
freeSpacing: false,
x: false,
n: false },
flagsAll: { g: true, i: true, m: true, s: true, u: true, y: true },
pattern:
{ namedCapturingGroups: false,
namedCapturingGroupsUnicode: false,
namedCapturingGroupsEmoji: false } }