Examples of valid input:
v
x x xx xxx xxxxx
Ok, it's probably not very useful, but I thought I'd post it anyway.
#!/usr/local/bin/perl use warnings; use strict; while (<>) { print "fibo\n" if /^\s*(?:((?(1)(?(3)(?(2)\2|\3)(\1)|(\S))|\S))\s+ +)+\z/; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: fibonacci regex
by TedYoung (Deacon) on Jan 25, 2005 at 15:39 UTC | |
by ambrus (Abbot) on May 10, 2010 at 19:27 UTC |