![]() |
|
Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
fibonacci regexby mauke (Novice) |
on Jan 25, 2005 at 13:54 UTC ( #424865=snippet: print w/replies, xml ) | Need Help?? |
#!/usr/local/bin/perl
use warnings;
use strict;
while (<>) {
print "fibo\n" if /^\s*(?:((?(1)(?(3)(?(2)\2|\3)(\1)|(\S))|\S))\s+
+)+\z/;
}
|
|