http://www.perlmonks.org?node_id=233432

bronto has asked for the wisdom of the Perl Monks concerning the following question:

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?

Ciao!
--bronto


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

Replies are listed 'Best First'.
Re: Patterns for your numbers
by adrianh (Chancellor) on Feb 07, 2003 at 11:13 UTC

      Thanks for the link, adrianh, it's on my notepad now.

      Anyway, as I said in the question, I am not looking for a module, nor I am looking for such a grainlevel control over "numeric strings".

      Call it a challenge (if you like): are those patterns ok? Would you write them differently for the sake of {efficiency|compactness|speed|readability|anything}? Would you compact all af them in a unique, catchall regex?

      That was the question.

      Please, don't feel offended about that: pointers to modules that do the job are useful and I don't despise them. But they are not an answer to the question

      Ciao!
      --bronto


      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
Re: Patterns for your numbers
by jryan (Vicar) on Feb 07, 2003 at 16:19 UTC
    Take a read at this entry in perlfaq4.