Function zeroOrMore

  • Match a token 0 to infinite times.

    Parameters

    • literal: string

    Returns RegExpToken

    Example

    zeroOrMore`foo`
    zeroOrMore.exactly`foo`
    zeroOrMore('foo')

    RegExp equivalent:

    /(?:foo)*/
    // !! unicode ending slash to escape comment ending !!

    Example

    Lazy matching

    zeroOrMoreLazily`foo`
    zeroOrMore.lazily`foo`

    RegExp equivalent:

    /(?:foo)*?/
    
  • Match a token 0 to infinite times.

    Parameters

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

    Returns RegExpToken

    Example

    zeroOrMore`foo`
    zeroOrMore.exactly`foo`
    zeroOrMore('foo')

    RegExp equivalent:

    /(?:foo)*/
    // !! unicode ending slash to escape comment ending !!

    Example

    Lazy matching

    zeroOrMoreLazily`foo`
    zeroOrMore.lazily`foo`

    RegExp equivalent:

    /(?:foo)*?/
    
  • Match a token 0 to infinite times.

    Parameters

    Returns RegExpToken

    Example

    zeroOrMore`foo`
    zeroOrMore.exactly`foo`
    zeroOrMore('foo')

    RegExp equivalent:

    /(?:foo)*/
    // !! unicode ending slash to escape comment ending !!

    Example

    Lazy matching

    zeroOrMoreLazily`foo`
    zeroOrMore.lazily`foo`

    RegExp equivalent:

    /(?:foo)*?/
    

Generated using TypeDoc