Starting to elucubrate from these nodes and perlnumber, I am wondering: which pattern (or patterns) cover any possible valid string representation of a number in Perl, leaving version numbers out?
What about these?
- Integer: ^\s*[+-]?\d+\s*$
- Binary: ^\s*[+-]?0b[0-1]+\s*$
- Octal: ^\s*[+-]?0[0-7]+\s*$
- With decimals:
The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
--John M. Dlugosz