Function ahead

  • Wrap the given token in a positive lookahead.

    Parameters

    • literal: string

    Returns RegExpToken

    Example

    ahead`foo`
    ahead.exactly`foo`
    ahead('foo')

    RegExp equivalent:

    /(?=foo)/
    

    Example

    Negated token - Negative lookahead

    notAhead`foo`
    not.ahead`foo`
    notAhead.exactly`foo`
    notAhead('foo')

    RegExp equivalent:

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

    Parameters

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

    Returns RegExpToken

    Example

    ahead`foo`
    ahead.exactly`foo`
    ahead('foo')

    RegExp equivalent:

    /(?=foo)/
    

    Example

    Negated token - Negative lookahead

    notAhead`foo`
    not.ahead`foo`
    notAhead.exactly`foo`
    notAhead('foo')

    RegExp equivalent:

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

    Parameters

    Returns RegExpToken

    Example

    ahead`foo`
    ahead.exactly`foo`
    ahead('foo')

    RegExp equivalent:

    /(?=foo)/
    

    Example

    Negated token - Negative lookahead

    notAhead`foo`
    not.ahead`foo`
    notAhead.exactly`foo`
    notAhead('foo')

    RegExp equivalent:

    /(?!foo)/
    

Generated using TypeDoc