Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Try this in Regexp palindrome

by bart (Canon)
on Mar 21, 2005 at 11:13 UTC ( [id://441176]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $re;
    $re = qr/((.)(??{ $re })\2|.)/;
    ...
        local $\ = "\n";  # add newline to print
        substr($s, $i) =~ /^$re/ and print $1;
    }
    
  2. or download this
    my $s = 'abcdegedfc';
    foreach my $i (0 .. length($s) - 1) {
    ...
        substr($s, $i) =~ /((.*).?(??{ quotemeta reverse $2 }))/
          and print $1;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-24 08:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found