• nroth@lemmy.world
    link
    fedilink
    arrow-up
    12
    ·
    14 days ago

    A non prime number of times… It looks like the string of characters could repeat number of times because the whole capture group repeats. I don’t see a prime constraint.

    • Feathercrown@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      14 days ago

      The capture group must be the same each time it repeats, so the number of characters stays the same. So X groups of Y characters = string of length X*Y. X and Y can be anything so any string length that can be made by multiplying two numbers-- which is every non-prime string length-- is matched. 0 and 1 are handled specially at the start.