in reply to palindrome using regular expressions
As for other solutions, there is of course the non-regex way of doing join '',reverse split //, $_ eq $_ but that is probably not what you are looking for.
Note that my $r = "(??{\$palindrome})"; is equivalent to my $r = '(??{$palindrome})';, there is no reference involved (as I thought at first glance).
Update: Minor typo correction
-- Hofmator
Code written by Hofmator and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: palindrome using regular expressions
by reneeb (Chaplain) on Oct 10, 2006 at 12:01 UTC | |
by Hofmator (Curate) on Oct 10, 2006 at 12:11 UTC | |
by strat (Canon) on Oct 11, 2006 at 07:58 UTC |