
Security News
Static vs. Runtime Reachability: Insights from Latio’s On the Record Podcast
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
regexp-support
Advanced tools
check RegExp ( regular expressions ) support
npm install regexp-support
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)
}
import support from 'regexp-support';
console.log(support);
aa(?=bb)
aa(?!bb)
(?<=\$)foo
const RE_DOLLAR_PREFIX = /(?<=\$)foo/g;
'$foo %foo foo'.replace(RE_DOLLAR_PREFIX, 'bar'); // => '$bar %foo foo'
(?<!\$)foo
const RE_NO_DOLLAR_PREFIX = /(?<!\$)foo/g;
'$foo %foo foo'.replace(RE_NO_DOLLAR_PREFIX, 'bar'); // => '$foo %bar bar'
{ nativeFlags: 'gimsuy',
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,
namedCapturingGroupsBackreference: true,
namedCapturingGroupsDuplicate: false,
lookAheadPositive: true,
lookAheadNegative: true,
lookBehindPositive: true,
lookBehindNegative: true,
dotUnicodeEmoji: true,
classSub: false },
prototype:
{ source: true,
flags: true,
lastIndex: true,
dotAll: true,
global: true,
ignoreCase: true,
multiline: true,
sticky: true,
unicode: true },
static:
{ '$1': true,
'$2': true,
'$3': true,
'$4': true,
'$5': true,
'$6': true,
'$7': true,
'$8': true,
'$9': true,
input: true,
'$_': true,
lastMatch: true,
'$&': true,
lastParen: true,
'$+': true,
leftContext: true,
'$`': true,
rightContext: true,
'$\'': true,
'$10': false,
'$100': false },
symbol:
{ species: false,
match: true,
replace: true,
search: true,
split: true },
objectStringTag: '[object RegExp]',
unicodeSet:
{ unicode: true,
script: true,
blocks: false,
unicodeTest:
{ C: true,
Other: true,
Cc: true,
Control: true,
Cs: true,
Surrogate: true,
L: true,
Letter: true,
LC: true,
Cased_Letter: true,
Ll: true,
Lowercase_Letter: true,
Lo: true,
Other_Letter: true,
Lu: true,
Uppercase_Letter: true,
M: true,
Mark: true,
Me: true,
Enclosing_Mark: true,
Mn: true,
Nonspacing_Mark: true,
N: true,
Number: true,
Nd: true,
Decimal_Number: true,
Nl: true,
Letter_Number: true,
No: true,
Other_Number: true,
P: true,
Punctuation: true,
Pc: true,
Connector_Punctuation: true,
Pd: true,
Dash_Punctuation: true,
Pe: true,
Close_Punctuation: true,
Pf: true,
Final_Punctuation: true,
Pi: true,
Initial_Punctuation: true,
Po: true,
Other_Punctuation: true,
Ps: true,
Open_Punctuation: true,
S: true,
Symbol: true,
Sc: true,
Currency_Symbol: true,
Sk: true,
Modifier_Symbol: true,
Sm: true,
Math_Symbol: true,
So: true,
Other_Symbol: true,
Z: true,
Separator: true,
Zl: true,
Line_Separator: true,
Zp: true,
Paragraph_Separator: true,
Zs: true,
Space_Separator: true,
ASCII: true,
Alphabetic: true,
Any: true,
White_Space: true,
Alpha: true,
Emoji: true,
Emoji_Component: true,
Emoji_Modifier: true,
Emoji_Presentation: true,
Ideographic: true,
Ideo: true,
Lower: true,
Quotation_Mark: true,
QMark: true,
Unified_Ideograph: true,
Upper: true,
Combining_Mark: true,
punct: true,
Digit: false,
Alnum: false,
Punct: false,
Graph: false,
Blank: false,
Cntrl: false,
XDigit: false,
Space: false,
Decimal_Digit_Number: false },
scriptTest:
{ Arabic: true,
Bengali: true,
Common: true,
Coptic: true,
Cyrillic: true,
Ethiopic: true,
Georgian: true,
Greek: true,
Han: true,
Hangul: true,
Hiragana: true,
Katakana: true,
Latin: true,
Tamil: true,
Tibetan: true,
Arab: true,
Beng: true,
Copt: true,
Cyrl: true,
Ethi: true,
Geor: true,
Grek: true,
Hani: true,
Hira: true,
Kana: true,
Latn: true,
Taml: true,
Tibt: true },
blocksTest: { InBasic_Latin: false } } }
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 } }
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 } }
FAQs
check RegExp ( regular expressions ) support
The npm package regexp-support receives a total of 3,249 weekly downloads. As such, regexp-support popularity was classified as popular.
We found that regexp-support demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.