@gruhn/regex-utils
    Preparing search index...

    Function repeat

    • Constructs quantified regular expressions, subsuming all these regex operators: *, +, {n,m}, ?.

      Parameters

      Returns StdRegex

      repeat(r) // r*
      repeat(r, 4) // r{4}
      repeat(r, { min: 3, max: 5 }) // r{3,5}
      repeat(r, { max: 5 }) // r{,5}
      repeat(r, { min: 3 }) // r{3,}
      repeat(r, { min: 0, max: 1 }) // r?
    • Constructs quantified regular expressions, subsuming all these regex operators: *, +, {n,m}, ?.

      Parameters

      Returns ExtRegex

      repeat(r) // r*
      repeat(r, 4) // r{4}
      repeat(r, { min: 3, max: 5 }) // r{3,5}
      repeat(r, { max: 5 }) // r{,5}
      repeat(r, { min: 3 }) // r{3,}
      repeat(r, { min: 0, max: 1 }) // r?