in reply to fibonacci regex
Nice, this reminds me of a function to test if a number if prime:
sub isPrime { ('1' x $_[0]) !~ /^(11+)\1+$/; }
Ted Young
($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: fibonacci regex
by ambrus (Abbot) on May 10, 2010 at 19:27 UTC |
In Section
Cool Uses for Perl