Function capture

  • Wrap the given token in a capture group.

    Parameters

    • literal: string

    Returns RegExpToken

    Example

    capture`foo`
    capture.exactly`foo`
    capture('foo')

    RegExp equivalent:

    /(foo)/
    
  • Wrap the given token in a capture group.

    Parameters

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

    Returns RegExpToken

    Example

    capture`foo`
    capture.exactly`foo`
    capture('foo')

    RegExp equivalent:

    /(foo)/
    
  • Wrap the given token in a capture group.

    Parameters

    Returns RegExpToken

    Example

    capture`foo`
    capture.exactly`foo`
    capture('foo')

    RegExp equivalent:

    /(foo)/
    

Generated using TypeDoc