App::MathImage::Regexp::Common::OEIS -- regexps for some OEIS things
use Regexp::Common 'OEIS', 'no_defaults'; if ($str =~ /$RE{OEIS}{anum}/) { # ... }
Experimental ...
This module is regexps for some things related to Sloane's Online Encyclopedia of Integer Sequences
See Regexp::Common for basic operation of Regexp::Common
.
$RE{OEIS}{anum}
Match an OEIS A-number, either 6 or 7 digits
A000040 A0234567
The -keep
option captures are
$1 whole string "A000040" $2 number part "000040"
A minimum of 6 digits are required, so for example "A123" is not an A-number.
As of Nov 2013 there are about 220,000 A-numbers in use so 6 digits suffice. Rumour has it the plan is to go 7 digits when a million sequences is reached and the regexp here anticipates that.
http://user42.tuxfamily.org/math-image/index.html
Copyright 2012, 2013 Kevin Ryde
Math-Image is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Math-Image is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Math-Image. If not, see <http://www.gnu.org/licenses/>.