Phone Numbers
The
Protector stage library includes the following category functions for phone numbers. You
can use these functions only in stages included in the Protector stage library.
- US_PHONE:areaCode()
- Returns the area code of United States phone numbers. The area code is the first three digits of a ten digit phone number.
- US_PHONE:areaCodeOrDefault(<default value>)
- Returns the area code of United States phone numbers. When the data does not include a recognizable area code, the function returns the specified default value.
- US_PHONE:exchangeCode()
- Returns the central office code, or exchange code, of United States phone numbers. The exchange code is the second three digits of a ten digit phone number.
- US_PHONE:lineNumber()
- Returns the line number, or subscriber number, of United States phone numbers. The line number is the last four digits of a ten digit phone number.
- US_PHONE:extension()
- Returns the extension associated with United States phone numbers. This
function expects the extension to be a set of numbers after the phone
number, preceded by an
x
. This function recognizes extensions when the phone number uses one of the following formats:<phone number>x<extension> <phone number> x<extension>
- US_PHONE:extensionOrDefault(<default value>)
- Returns the extension associated with United States phone numbers. When the
data does not include a recognizable extension, the function returns the
specified default value. This function recognizes extensions when the phone
number uses one of the following
formats:
<phone number>x<extension> <phone number> x<extension>
- US_PHONE:std()
- Returns United States phone numbers using the following standard format:
such as:+1 (<area code>) <exchange>-<line number> [x<extension>]
+1 (xxx)xxx-xxxx
.