Just a small note: Phone numbers are very different from region to region, and simply cutting off some digits here and there will likely damage them. The US notation 555-1234-567 looks completely strange to someone living in Europe, and vanity numbers like 555-SHOE-SHOP were nearly unknown until a few years ago. Not that we europeans would share a common notation. The german standards recommend to have pairs of digits, right-aligned, with private extensions indicated by a dash, and the long distance prefix either in brackets or with a slash: 0 12 34 / 5 67 89-1 23. For regional phone numbers, the prefix is usually omitted. Other countries group three digits, or don't group at all, some have no concept of long-distance calls. Various characters are used to separate digit groups, like white space, dots, slashes, dashes, and brackets. So, any random group of up to 13(? - ITU limit) digits with optional interpunctation could be a valid phone number. When it comes to vanity numbers, things get even worse.

Several libraries that pretend to be able to handle phone numbers can in fact handle only US phone numbers and fail miserably when they are confronted with non-US phone numbers.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re: Trim Phone Numbers by afoken
in thread Trim Phone Numbers by kirkbrown

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.