Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Nonrepeating characters in an RE

by AnomalousMonk (Archbishop)
on Aug 17, 2022 at 13:51 UTC ( #11146191=note: print w/replies, xml ) Need Help??


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?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11146191]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2023-02-04 02:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (30 votes). Check out past polls.

    Notices?