3 ms·
At my first job out of college I wrote a client-side phone number validator for US phone numbers. I was quite pleased with myself at the time, but I'm sure it w
by mauvehaus 2y ago
At my first job out of college I wrote a client-side phone number validator for US phone numbers. I was quite pleased with myself at the time, but I'm sure it was crap in retrospect. I remember reading up on the North American Numbering Plan and being sure to exclude phone numbers with e.g. a prefix starting with 1 and the 555 numbers that are unassigned (which is not all of them, to be clear).
Sorry if you got stuck maintaining it :-)
As an aside, my fake phone number for bullshit store loyalty programs is 420-911-6969. CVS seems to cull it reliably, but other places have accepted it. I'm amazed that no human I've given that to has asked if it's actually my phone number.