Skip to main content

RegExp Syntax ↔ JS-specific regex syntax

regexp **body**

of RegExp expression (abc) inside /abc/

regexp atom

basic building block of RegExp

Flag

optional modifier for RegExp to config how Assertion behave on patterns

RegExp Literal Notation

Literal JS Syntax to create RegExp, execute at Compile Time

const re = /pattern/flags;

RegExp Constructor Notation

RegExp Syntax to call RegExp() to execute RegExp expression at Runtime

const re = new RegExp(_regExpPattern: RegExp, flags = regExp.flags)

References

  1. AssertionRegExp Syntax to define boundary of lines/words

  2. RegExp Constructor NotationRegExp Syntax to call RegExp() to execute RegExp expression at Runtime

const re = new RegExp(_regExpPattern: RegExp, flags = regExp.flags)
  1. Character ClassRegExp Syntax [] to wrap Class Range or Pattern Character

  2. (a|b|c)RegExp Syntax to Group to alternatives | delimit

  3. QuantifierRegExp Syntax to express # repetitions to match