Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re2: Simple Regex

by Juerd (Abbot)
on Apr 08, 2002 at 17:33 UTC ( [id://157492]=note: print w/replies, xml ) Need Help??


in reply to Re2: Simple Regex
in thread Simple Regex

However, you still have to worry about malformations, such as phone numbers that aren't 7 or 10 digits.

So every database has numbers only within a single country? Not like any database I've ever used. I even thought about not filtering out leading plusses, but didn't do so, because I think this was homework anyway - and there should still be a challenge.

As for 7 or 10 digits, I had no idea about how other countries have their telephone numbers, and think I should not guess.

The fix: check length.

U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk

Replies are listed 'Best First'.
Re: Re: Re2: Simple Regex
by demerphq (Chancellor) on Apr 08, 2002 at 17:53 UTC
    Juerd you're showing your europeanism... :-)

    So every database has numbers only within a single country? Not like any database I've ever used.

    Dont forget that ALL of North America (and the Bahamas) uses the same country code (1) and even more unlike Europe they use a standardized number format (3-3-4) _and_ they use extensions (which Germany for example does not).

    I even thought about not filtering out leading plusses

    Most North Americans dont know what the plus would mean anyway. (heh)

    The fix: check length.

    Unfortunately that doesnt work, the extension can be practically any number you like...

    Now you know how I felt when I first got to Europe... Confused. (And lets not even talk about different dial tones and signals, I still get confused sometimes if it ringing or not....)

    :-)

    Yves / DeMerphq
    ---
    Writing a good benchmark isnt as easy as it might look.

      Dont forget that ALL of North America (and the Bahamas) uses the same country code (1) and even more unlike Europe they use a standardized number format (3-3-4) _and_ they use extensions (which Germany for example does not).

      Do you imply that Americans never dial numbers outside of their +1 area?

      U28geW91IGNhbiBhbGwgcm90MTMgY
      W5kIHBhY2soKS4gQnV0IGRvIHlvdS
      ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
      geW91IHNlZSBpdD8gIC0tIEp1ZXJk
      

        So rarely that they don't know about +1 being our international area. =) And when they do, they get real confused and get an operator to help until they've done it a bit.

        --
        $you = new YOU;
        honk() if $you->love(perl)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://157492]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-24 09:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found