RegExp
↔ regex Global Object to make Regular Expressions in JS
RegExp()
Constructor Function for new RegExp
Object
Source: developer.mozilla.org/en
RegExp Syntax
JS-specific regex syntax
References
RegExp()
↔ Constructor Function for newRegExp
ObjectRegExp Literal Notation
↔ Literal JS Syntax to createRegExp
, execute at Compile Time
const re = /pattern/flags;
regexp atom
↔ basic building block ofRegExp
\n
↔RegExp
Control Character Escape for New line feed (LF) character\f
↔RegExp
Control Character Escape for Form feed (FF) character\r
↔RegExp
Control Character Escape for carriage Return (CR) character\t
↔RegExp
Control Character Escape for Tab character\v
↔RegExp
Control Character Escape for vertical line tabulation\cA
↔RegExp
Arbitrary Character Escape for Ctrl+A\cZ
↔RegExp
Arbitrary Character Escape for Ctrl+ZRegExp Constructor Notation
↔ RegExp Syntax to callRegExp()
to executeRegExp
expression at Runtime
const re = new RegExp(_regExpPattern: RegExp, flags = regExp.flags)
Flag
↔ optional modifier forRegExp
to config how Assertion behave on patterns[^abc]
↔RegExp
Negated Character Class to NOT match charsabc
in bracket[0-9]
↔RegExp
Character Class to match digit range from 0-9[A-z]
↔RegExp
Character Class to match letter range (a-z & A-Z)[:punct:]
↔RegExp
Character Class to match punctuation char[:space:]
↔RegExp
Character Class to match space charGroup
↔RegExp
JS Syntax using()
to group togetherRegExp
expressions[:blank:]
↔RegExp
Character Class to match space or tab char^[abc]
↔RegExp
Character Class to match at line start char?
↔ OptionalRegExp
Quantifier to match never or once*
↔ ≥0RegExp
Quantifier to match zero or more+
↔ ≥1RegExp
Quantifier to match 1+.*abc.*
↔RegExp
Quantifier to match any phrase containsabc
between anything/nothing{n}
↔RegExp
Quantifier to match exactlyn
times{n,}
↔RegExp
Quantifier to matchn
or more times^
↔RegExp
Assertion to negate Character Class or only match start of line{n,m}
↔RegExp
Quantifier to match betweenn-m
times.*
↔RegExp
Quantifier to match anything & everything^n
↔RegExp
Quantifier to matchn
string
at line begin?=n
↔RegExp
Quantifier to matchstring
aftern
string?!n
↔RegExp
Quantifier to matchstring
not aftern
string|
↔RegExp
Assertion OR operator for alternative characters/expressions\b
↔RegExp
Assertion to match only at boundary of word (beginning or end of word)\B
↔ invertedRegExp
Assertion to match only at not boundary of word (beginning or end of word)u
↔ Flag to setRegExp
Pattern Character as Unicode\n
↔RegExp
back ref to numbered Capture GroupMetacharacter
↔\ ^ $ . * + ? ( ) [ ] { } |
special reservedRegExp
character with special (non-literal) meaning to define search criteria/manipulationexcludeStories
↔ to set mocked state data as non-story export, viastring[]
||RegExp
regexp **body**
↔ ofRegExp
expression (abc
) inside /abc/