Function oneOrMore

  • Match a token 1 to infinite times.

    Parameters

    • literal: string

    Returns RegExpToken

    Example

    oneOrMore`foo`
    oneOrMore.exactly`foo`
    oneOrMore('foo')

    RegExp equivalent:

    /(?:foo)+/
    

    Example

    Lazy matching

    oneOrMoreLazily`foo`
    oneOrMore.lazily`foo`

    RegExp equivalent:

    /(?:foo)+?/
    
  • Match a token 1 to infinite times.

    Parameters

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

    Returns RegExpToken

    Example

    oneOrMore`foo`
    oneOrMore.exactly`foo`
    oneOrMore('foo')

    RegExp equivalent:

    /(?:foo)+/
    

    Example

    Lazy matching

    oneOrMoreLazily`foo`
    oneOrMore.lazily`foo`

    RegExp equivalent:

    /(?:foo)+?/
    
  • Match a token 1 to infinite times.

    Parameters

    Returns RegExpToken

    Example

    oneOrMore`foo`
    oneOrMore.exactly`foo`
    oneOrMore('foo')

    RegExp equivalent:

    /(?:foo)+/
    

    Example

    Lazy matching

    oneOrMoreLazily`foo`
    oneOrMore.lazily`foo`

    RegExp equivalent:

    /(?:foo)+?/
    

Generated using TypeDoc