• @RegalPotoo
    link
    English
    185 hours ago

    Syntactically valid Perl

    • @RegalPotoo
      link
      English
      7
      edit-2
      4 hours 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”!<

      • @NateNate60OP
        link
        23 hours ago

        It’s a line with a sequence of two or more characters repeated at least twice.

        • @[email protected]
          link
          fedilink
          English
          33 hours ago

          Only the part after the pipe character. The pipe character works as an “or” operator. RegalPotoo is right.

          • @NateNate60OP
            link
            22 hours 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”.

            • @[email protected]
              link
              fedilink
              255 minutes ago

              I agree, you’re right about the part after the pipe and RegalPotoo’s explanation was not entirely correct.