Function octal

  • Parameters

    • literal: string

    Returns RegExpToken

    Deprecated

    Octal escape sequences (\ followed by one, two, or three octal digits) are deprecated in string and regular expression literals.


    Match a character with the given code point in base-8.

    Notes:

    The RegExp output of octal is always wrapped in a character class to disambiguate it from capture group back-references.

    The maximum allowed value is 0o377, which is equivalent to 0xff.

    Example

    octal`123`
    octal('123')

    RegExp equivalent:

    /[\123]/
    

    Example

    Negated token

    not.octal`123`
    not(octal('123'))

    RegExp equivalent:

    /[^\123]/
    
  • Parameters

    • template: TemplateStringsArray
    • Rest ...args: unknown[]

    Returns RegExpToken

    Deprecated

    Octal escape sequences (\ followed by one, two, or three octal digits) are deprecated in string and regular expression literals.


    Match a character with the given code point in base-8.

    Notes:

    The RegExp output of octal is always wrapped in a character class to disambiguate it from capture group back-references.

    The maximum allowed value is 0o377, which is equivalent to 0xff.

    Example

    octal`123`
    octal('123')

    RegExp equivalent:

    /[\123]/
    

    Example

    Negated token

    not.octal`123`
    not(octal('123'))

    RegExp equivalent:

    /[^\123]/
    

Generated using TypeDoc