in reply to Re: Nonrepeating characters in an RE
in thread Nonrepeating characters in an RE

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:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^3: Nonrepeating characters in an RE
by Anonymous Monk on Aug 17, 2022 at 14:18 UTC

    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?