ACME Corporation is starting out on their data privacy and compliance journey. One of ACME Corporation's goals is to search across the company's network to determine all data storage locations that contain customer information and to ensure these storage locations are adequately protected.
As customer information is always associated with a unique customer ID, ACME Corporation has built a custom GLASS data type to search for customer ID numbers.
ACME Corporation's customer ID numbers can fall into two categories: (i) regional, or (ii) worldwide.
The format for customer IDs are as follows:
<ccTLD><9-digit serial number><check digit>
WW<YYMMDD><5-digit serial number><check digit>
Where:
Component | Description | Valid Values |
---|---|---|
ccTLD |
Country code top-level domain. | AU , IE , KR , SG , UK , US . |
serial number |
A 9-digit (regional) or 5-digit (worldwide) serial number that starts at 1. The first serial number for the regional and worldwide customer IDs are 000000001 and 00001 respectively. |
Regional: 000000001 to 999999999 , Worldwide: 00001 to 99999 . |
check digit |
A single check digit that is computed from all the other characters in the customer ID number using the check digit algorithm adopted for use in Machine Readable Travel Documents (MRTDs). See Section 4.9: ICAO Doc 9303 - Machine Readable Travel Documents for more information. | Single integer between 0 to 9 . |
YYMMDD |
A valid short date representing the expiration date of the customer ID, where - YY is the 2-digit year between 00 to 99 , - MM is the 2-digit month between 01 to 12 , and - DD is the 2-digit date between 01 - 31 . |
Any date between 1901-01-01 and 2099-12-31. |
ACME Corporation expects a customer ID number to only be bounded by non-alphanumeric characters on either side to be valid.
ACME Corporation also identified a set of words (in various supported languages) that can commonly be found within a certain range of a customer ID number. These are known as contextual keywords. For example:
cust id
, custid
, customer
client
cliente
kunde
고객
Some valid samples of customer ID numbers:
Category | Customer ID Sample |
---|---|
Regional | AU2648761235 , IE4871209841 , KR8837000014 , SG0000137492 , UK0027738122 , US1003992835 |
Worldwide | WW301231018313 , WW410425001348 |
Some invalid samples of customer ID numbers:
Category | Customer ID Sample | Notes |
---|---|---|
Regional | ZZ7366198321 |
Invalid ccTLD prefix (ZZ ) |
Regional | US0000000004 |
Invalid serial number (000000000 ) |
Regional | AU7366198329 |
Invalid check digit (9 ) |
Worldwide | ZZ301231018313 |
Invalid prefix (ZZ ) |
Worldwide | WW301231000002 |
Invalid serial number (00000 ) |
Worldwide | WW300229018317 |
Invalid short date (300229 ) |
Worldwide | WW301231018311 |
Invalid check digit (1 ) |
Using GLASS Studio, ACME Corporation built two versions of the custom data type to search for customer ID numbers:
For a breakdown of how to build these two data types, see Building and Defining GLASS Patterns and GLASS Examples for more information.
As the structure of the customer ID numbers are fairly unique, this version only searches for the customer ID in data storage locations.
MAP 'INVALID_SERIAL_NUM' 0
MAP 'DAY_OF_MONTH_LOOKUP' 1-31
MAP 'MONTH_OF_YEAR_LOOKUP' 1-12
MAP NOCASE 'ACME_CUST_ID_CCTLD' 'AU', 'IE', 'KR', 'SG', 'UK', 'US'
( \
( \
( \
( \
GROUP 'ACME_CUST_ID_CCTLD' THEN \
(RANGE DIGIT TIMES 9 EXCLUDE 'INVALID_SERIAL_NUM') THEN RANGE DIGIT \
) CHECK 'PASSPORTMOD10' \
) \
OR \
( \
( \
WORD NOCASE 'WW' THEN \
( \
( \
(RANGE DIGIT TIMES 2) THEN \
(RANGE DIGIT TIMES 2 REQUIRE 'MONTH_OF_YEAR_LOOKUP') THEN \
(RANGE DIGIT TIMES 2 REQUIRE 'DAY_OF_MONTH_LOOKUP') \
) CHECK 'VALID_DATE_YYMMDD' \
) THEN \
(RANGE DIGIT TIMES 5 EXCLUDE 'INVALID_SERIAL_NUM') THEN \
RANGE DIGIT \
) CHECK 'PASSPORTMOD10' \
) \
) BOUND NONALNUM \
)
The Robust version of the data type enhances the Relaxed version by searching
for customer IDs and specific context (e.g. customer
, cliente
) surrounding
the customer ID numbers for greater pattern matching accuracy.
MAP 'INVALID_SERIAL_NUM' 0
MAP 'DAY_OF_MONTH_LOOKUP' 1-31
MAP 'MONTH_OF_YEAR_LOOKUP' 1-12
MAP NOCASE 'ACME_CUST_ID_CCTLD' 'AU', 'IE', 'KR', 'SG', 'UK', 'US'
MAP NOCASE 'ACME_CUST_ID_CONTEXTS' 'cust id', 'custid', 'customer', 'client', 'cliente', 'kunde', '고객'
CONTEXT 'ACME_CUST_ID_CONTEXT' BEFORE REQUIRE 'ACME_CUST_ID_CONTEXTS'
( \
( \
( \
( \
GROUP 'ACME_CUST_ID_CCTLD' THEN \
(RANGE DIGIT TIMES 9 EXCLUDE 'INVALID_SERIAL_NUM') THEN RANGE DIGIT \
) CHECK 'PASSPORTMOD10' \
) \
OR \
( \
( \
WORD NOCASE 'WW' THEN \
( \
( \
(RANGE DIGIT TIMES 2) THEN \
(RANGE DIGIT TIMES 2 REQUIRE 'MONTH_OF_YEAR_LOOKUP') THEN \
(RANGE DIGIT TIMES 2 REQUIRE 'DAY_OF_MONTH_LOOKUP') \
) CHECK 'VALID_DATE_YYMMDD' \
) THEN \
(RANGE DIGIT TIMES 5 EXCLUDE 'INVALID_SERIAL_NUM') THEN \
RANGE DIGIT \
) CHECK 'PASSPORTMOD10' \
) \
) BOUND NONALNUM \
) APPLY 'ACME_CUST_ID_CONTEXT'