regexp-coder
    Preparing search index...

    Class RegExpSpec

    Regular Expression Specification

    • Provide basic elements of Javascript/Type Regular Expression
    Index
    alphanumeric: string = '\\w'

    \w, Matches any alphanumeric character including the underscore.

    word

    any: string = '.'

    ., Matches any single character except the newline character, by default. Alias of dot.

    dot

    asterisk: string = '*'

    *, Matches the preceding expression 0 or more times. Equivalent to {0,}.

    backslash: string = '\\'

    ``, backslash.

    backspace: string = '[\\b]'

    [\b], Matches a backspace (U+0008).

    begin: string = '^'

    ^, Matches beginning of input. If the multiline flag is set to true, also matches immediately after a line break character.

    @see: Caret

    carriageReturn: string = '\\r'

    \r, Matches a carriage return (U+000D).

    caseInsensitiveSearchFlag: string = 'i'

    i, Case-insensitive search.

    digit: string = '\\d'

    \d, Matches a digit character. Equivalent to [0 - 9].

    digit

    dot: string = '.'

    ., Matches any single character except the newline character, by default.

    dot

    dotIsNewLineFlag: string = 's'

    s, Allows . to match newline characters.

    end: string = '$'

    $, Matches end of input. If the multiline flag is set to true, also matches immediately before a line break character.

    dollar

    formfeed: string = '\\f'

    \f, Matches a form feed (U+000C).

    globalSearchFlag: string = 'g'

    g, Global search.

    linefeed: string = '\\n'

    \n, Matches a line feed (U+000A).

    more: string = '*'

    *, Matches the preceding expression 0 or more times. Equivalent to {0,}. Alias of asterisk.

    multipleLineSearchFlag: string = 'm'

    m, Multi-line search.

    nonDigit: string = '\\D'

    \D, Matches a non-digit character. Equivalent to [^ 0 - 9].

    nonWhitespace: string = '\\S'

    \S, Matches a character other than white space.

    nonWord: string = '\\W'

    \W, Matches any non-word character.

    nonWordBoundary: string = '\\B'

    \B, Matches a non-word boundary.

    null: string = '\\0'

    \0, Matches a NULL (U+0000) character.

    null

    oneOrMore: string = '+'

    +, Matches the preceding expression 1 or more times. Equivalent to {1,}. Alias of plus.

    plus

    plus: string = '+'

    +, Matches the preceding expression 1 or more times. Equivalent to {1,}.

    plus

    questionmark: string = '?'

    ?, Matches the preceding expression 0 or 1 time. Equivalent to {0,1}.

    stickySearchFlag: string = 'y'

    y, Perform a "sticky" search that matches starting at the current position in the target string.

    sticky

    strickySearchFlag: string = 'y'

    y, Perform a "sticky" search that matches starting at the current position in the target string. Alias of stickySearchFlag, kept for backward compatibility.

    Use stickySearchFlag instead.

    sticky

    tab: string = '\\t'

    \t, Matches a tab (U+0009).

    tab

    unicodeFlag: string = 'u'

    u, "unicode"; treat a pattern as a sequence of unicode code points.

    verticalTab: string = '\\v'

    \v, Matches a vertical tab (U+000B).

    whitespace: string = '\\s'

    \s, Matches a white space character, including space, tab, form feed, line feed.

    wordBoundary: string = '\\b'

    \b Matches a word boundary.

    zeroOrOne: string = '?'

    ?, Matches the preceding expression 0 or 1 time. Equivalent to {0,1}. Alias of questionmark.

    • \n, Where n is a positive integer, a back reference to the last substring matching the n parenthetical in the regular expression (counting left parentheses).

      Parameters

      • n: number

      Returns string

    • (x), Matches x and remembers the match. The parentheses are called capturing parentheses. (?<name>x), Named capturing group: Matches x and stores it on the groups property of the returned matches under the name specified by .

      Parameters

      • x: string | RegExp

        expression

      • Optionalname: string

        name

      Returns string

    • [xyz], Character set.

      Parameters

      • ...chars: string[]

      Returns string

    • \cX Matches a control character in a string.

      Parameters

      • X: string

        a character ranging from A to Z.

      Returns string

      control

    • \xhh, Matches the character with the code hh.

      Parameters

      • hh: string

        two hexadecimal digits

      Returns string

    • x(?=y), Matches x only if x is followed by y. This is called a lookahead.

      Parameters

      • x: string | RegExp

        expression

      • followedBy: string | RegExp

        the followed by expression

      Returns string

    • (?<=y)x, Matches x only if x is preceded by y. This is called a lookbehind.

      Parameters

      • x: string | RegExp

        expression

      • precededBy: string | RegExp

        the preceded by expression

      Returns string

    • [^xyz], A negated or complemented character set.

      Parameters

      • ...chars: string[]

      Returns string

    • x(?!y) Matches x only if x is not followed by y. This is called a negated lookahead.

      Parameters

      • x: string | RegExp

        expression

      • notFollowedBy: string | RegExp

        the not followed by expression

      Returns string

    • (?<!y)x, Matches x only if x is not preceded by y. This is called a negated lookbehind.

      Parameters

      • x: string | RegExp

        expression

      • notPrecededBy: string | RegExp

        the not preceded by expression

      Returns string

    • (?:x), Matches x but does not remember the match. The parentheses are called non-capturing parentheses.

      Parameters

      • x: string | RegExp

        expression

      Returns string

    • {n}, Matches exactly n occurrences of the preceding expression. N must be a positive integer.

      Parameters

      • n: number

        times of occurrences

      Returns string

    • {n,}, {n,m}, Matches at least n occurrences of the preceding expression. N must be a positive integer. Where n and m are positive integers and n <= m. Matches at least n and at most m occurrences of the preceding expression. When m is omitted, it's treated as ∞.

      Parameters

      • n: number

        at least occurrences

      • Optionalm: number

        (optional) at most occurrences

      Returns string

    • x|y, Matches 'x', or 'y' (if there is no match for 'x').

      Parameters

      • ...items: (string | RegExp)[]

        expression

      Returns string

      or

    • \uhhhh Matches the character with the code hhhh.

      Parameters

      • hhhh: string

        four hexadecimal digits

      Returns string

    • \u{hhhh} (only when u flag is set) Matches the character with the Unicode value hhhh (hexadecimal digits).

      Parameters

      • hhhh: string

        four hexadecimal digits

      Returns string