in reply to Nonrepeating characters in an RE

I'm possibly missing something since all the other responses are so complex, but here goes anyway:

my @test = qw/abc aab abb aba/; for (@test) { say if not /(.).*?\1/; }

Replies are listed 'Best First'.
Re^2: Nonrepeating characters in an RE
by AnomalousMonk (Archbishop) on Aug 17, 2022 at 13:51 UTC

    What you and I and, it seems, everyone else are missing is a clear understanding of BernieC's requirements.

    What I understand (or imagine I understand) is that one must detect repetition only of a set of characters given in a "template" string. So if the template is 'abc', the string 'xxxabcxxx' has no repetition and the string 'aba' does. See Re^3: Nonrepeating characters in an RE (updated) and Re: Nonrepeating characters in an RE (updated) for my take on solutions to what I imagine BernieC's requirements to be.


    Give a man a fish:  <%-{-{-{-<

      Well, in that case...

      my @test = qw/xyzabcxxx xyzaabxxx xyzabbxxx xyzabaxxx/; for (@test) { # only check for 'abc' say if not /([abc]).*?\1/; }

      Still quite simple, isn't it?