SearchResults

Phone Numbers

How does SearchResults look for phone numbers?

(SearchResults does some work with international phone number formats, but most of the tricky stuff concerns US numbers, which we'll discuss here.)

Let's assume that the customer has the following valid phone formats:

(503) 123-4556
(503)123-4567
503/123-4567
503-123-4567
503.123.4567
123-4567
123.4567

[The following we consider to be invalid: 503.123-4567, 5031234567, 503-1235678 ]

The user will most likely enter this into the search field:

A 123-4567
B 123.4567
C 503-123-4567
D 503.123.4567

To achieve this, we use the following 4 search requests on every search in a Phone table:

1. The original string
2. If the user entered format A or C, substitute . for -
3. If the user entered format B or D, substitute - for .
4. If the user entered a 10 digit phone (in any type of format), search for just the last 8 digits of what they enter (which includes either the . or -)

In this way, we get these results, with or without the area code:

SerachResults can be modified to perform looser searches to find more numbers,but some of these can slow your searches down. It is our recommendation that if you can't find phone numbers you're looking for, you introduce *s into your search criteria (searching for *123-4567 if you're not sure of the area code) rather than hard code *s into SearchResults search scripts, which would slow down all searches.

(855) SEEDCODE
[email protected]
Follow us: