Function repeatLazily

  • Match a token the specified amount of times, trying to match as short as possible. Supply 1 parameter for an exact number of times, or 2 parameters for min/max.

    repeatLazily is a short form of repeat.lazily. See the documentation of repeat for more details.

    Parameters

    • min: number
    • Optional max: number

    Returns LiteralFunction & TokenFunction & RegExpToken

    Example

    repeatLazily(3,5)`foo`
    repeat.lazily(3,5)`foo`

    RegExp equivalent:

    /(?:foo){3,5}?/
    

Generated using TypeDoc