Sorry in advance, but this probably won't be the best answer you could get, (but hey, i'm reasonably drunk now so..)

Zen teaches that it is as important to understand what you cannot be aware of as that which you can.

Hence, it seems to me that the problem is not your regexs, that you are trying not only to match two different sets of numbers, whilst relying on normal people to apply a convention to the numbers. This is not something you can guarantee.

Perhaps try to preprocess the number within the file to the standards you expect to see, in order to differeniate between prices and telephone numbers. It is, I believe, unlikely that a telephone number (in terms of numerical value) could be mistaken for a price, or vice versa (in terms of currency notation).

damn I just re-read that, and although I stand by my advice, doesn't it sound pretentious? :P

Although to be fair, I ain't a programmer. But the reason bioinformaticians use PERL is essentially just because of the excellent regexes.


In reply to Re: pricing and phone number regexes by karmacide
in thread pricing and phone number regexes by coldfingertips

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.