Function maybeLazily

  • Match a token 0 or 1 times, trying to match as short as possible.

    maybeLazily is a short form of maybe.lazily. See the documentation of maybe for more details.

    Parameters

    • literal: string

    Returns RegExpToken

    Example

    maybeLazily`foo`
    maybe.lazily`foo`

    RegExp equivalent:

    /(?:foo)??/
    
  • Match a token 0 or 1 times, trying to match as short as possible.

    maybeLazily is a short form of maybe.lazily. See the documentation of maybe for more details.

    Parameters

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

    Returns RegExpToken

    Example

    maybeLazily`foo`
    maybe.lazily`foo`

    RegExp equivalent:

    /(?:foo)??/
    
  • Match a token 0 or 1 times, trying to match as short as possible.

    maybeLazily is a short form of maybe.lazily. See the documentation of maybe for more details.

    Parameters

    Returns RegExpToken

    Example

    maybeLazily`foo`
    maybe.lazily`foo`

    RegExp equivalent:

    /(?:foo)??/
    

Generated using TypeDoc