Function unicode

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

    Notes:

    Both hex and unicode have the same effect, but hex uses the single-byte escape sequence \xff if possible, while unicode always uses the 2-byte sequence \uffff.

    Parameters

    • literal: string

    Returns RegExpToken

    Example

    unicode`3ef1`
    unicode('3ef1')

    RegExp equivalent:

    /\u3ef1/
    

    Example

    Negated token

    not.unicode`3ef1`
    not(unicode('3ef1'))

    RegExp equivalent:

    /[^\u3ef1]/
    
  • Match a character with the given code point in base-16.

    Notes:

    Both hex and unicode have the same effect, but hex uses the single-byte escape sequence \xff if possible, while unicode always uses the 2-byte sequence \uffff.

    Parameters

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

    Returns RegExpToken

    Example

    unicode`3ef1`
    unicode('3ef1')

    RegExp equivalent:

    /\u3ef1/
    

    Example

    Negated token

    not.unicode`3ef1`
    not(unicode('3ef1'))

    RegExp equivalent:

    /[^\u3ef1]/
    

Generated using TypeDoc