• RegalPotoo@lemmy.world
    link
    fedilink
    English
    arrow-up
    10
    ·
    edit-2
    22 days ago

    Something like

    !“A line with exactly 0 or 1 characters, or a line with a sequence of 1 or 3 or more characters, repeated at least twice”!<

    • naonintendois
      link
      fedilink
      arrow-up
      8
      ·
      22 days ago

      You’re misreading the ..+? part. That means 2 or more characters, non greedy.

        • NateNate60@lemmy.worldOP
          link
          fedilink
          arrow-up
          3
          ·
          22 days ago

          They said—

          A line with exactly 0 or 1 characters, or a line with a sequence of 1 or 3 or more characters, repeated at least twice

          Note—

          …or a line with a sequence of 1 or 3 or more characters, repeated at least twice

          It should be—

          …or a line with a sequence of 2 or more characters, repeated at least twice

          The regex in the post will match “abab”. Their original description (line 2 of this comment) will not match “abab”.