Function behind

  • Wrap the given token in a positive lookbehind.

    Parameters

    • literal: string

    Returns RegExpToken

    Example

    behind`foo`
    behind.exactly`foo`
    behind('foo')

    RegExp equivalent:

    /(?<=foo)/
    

    Example

    Negated token - Negative lookbehind

    notBehind`foo`
    not.behind`foo`
    notBehind.exactly`foo`
    notBehind('foo')

    RegExp equivalent:

    /(?<!foo)/
    
  • Wrap the given token in a positive lookbehind.

    Parameters

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

    Returns RegExpToken

    Example

    behind`foo`
    behind.exactly`foo`
    behind('foo')

    RegExp equivalent:

    /(?<=foo)/
    

    Example

    Negated token - Negative lookbehind

    notBehind`foo`
    not.behind`foo`
    notBehind.exactly`foo`
    notBehind('foo')

    RegExp equivalent:

    /(?<!foo)/
    
  • Wrap the given token in a positive lookbehind.

    Parameters

    Returns RegExpToken

    Example

    behind`foo`
    behind.exactly`foo`
    behind('foo')

    RegExp equivalent:

    /(?<=foo)/
    

    Example

    Negated token - Negative lookbehind

    notBehind`foo`
    not.behind`foo`
    notBehind.exactly`foo`
    notBehind('foo')

    RegExp equivalent:

    /(?<!foo)/
    

Generated using TypeDoc