Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: substrings that consist of repeating characters

by salva (Canon)
on Sep 29, 2020 at 09:26 UTC ( [id://11122320]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $len = 0;
    my $best = "";
    ...
    }
    
    print "best: $best\n"
    
  2. or download this
    my $best = "";
    while ($string =~ /((.)\2+)/g) {
    ...
    }
    
    print "best: $best\n"
    
  3. or download this
    my $best = "";
    $best = $1 while $string =~ /((.)\2*)(*SKIP)(?(?{length $^N <= length 
    +$best})(*FAIL))/g;
    
    print "best: $best\n"
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 23:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found