Regular Expression Pattern Creation

Regular Expressions are patterns that can be used to trigger Events in Aware. They look for a very specific combination of character, keyword or numbers patterns within your connected Content Platform.

Examples of regular expressions are account numbers, addresses, credit card numbers, national identification numbers, etc. We have created and validated many common patterns for you and they are available in Aware. if you would like to create a pattern for something industry or company specific, like an employee ID or Customer Account Number read below for some helpful tips.

Keep in mind that your Customer Success Manager can help to build and validate a regular expression pattern for your use. 

Check out http://www.regexr.com or https://www.regex101.com for a simple regular expression tool.


Creating a Regular Expression:

There are many ways to go about creating regular expressions but one of the most common ways is to follow these instructions:

  1. Identify the type of pattern you are trying to find within a message (e.g. 6 digit number separated by dashes ##-##-##)
  2. Use a RegEx tool for help when creating your pattern. The regular expression for this pattern is: \b\d{2}-\d{2}-\d{2}\b

    Hint: Validate in a RegEx tool or Aware that the pattern is correct and will bring back the intended content

Below are some examples of Regular Expression Patters that we do not have available in our product:

 


Personally Identifiable Information (PII):

The following patterns match types of information that many countries consider to be personally identifiable.

 

China (PRC)

Identity card number - Pattern(s): Matches an 18 digit number.

\b\d{18}\b

 

Finland

Personal identification number - Pattern(s): Matches an 11 digit number where the last digit is sometimes a character.

\b\d{10}\w\b

  

 

Ireland

Personal public service number - Pattern(s): Matches a 7 digit number followed by two trailing characters.

\b\d{7}[a-zA-Z]{2}\b

 

Israel

National identification number - Pattern(s): Matches an 9 digit number.

\b\d{9}\b

 

Italy

Codice Fiscale - Pattern(s): Matches 6 characters, followed by 9 digits with a final trailing character.

\b[a-zA-Z]{6}\d{9}\w\b

 

Poland

National identification number (PESEL) - Pattern(s): Matches an 11 digit number.

\b\d{11}\b

 

South Korea

Resident registration number - Pattern(s): Matches a 6 digit number followed by a dash and 7 trailing digits.

\b\d{6}-\d{7}\b

 

Sweden

National identification number - Pattern(s): Matches a 6 digit number followed by a dash and 4 trailing digits.

\b\d{6}-\d{4}\b

 

Switzerland

Social security number - Pattern(s): Matches an 11 digit number with two different groupings.AAA.BB.CCC.DDD or the newer 756.XXXX.XXXX.XY

\b\d{3}[.]\d{2}[.]\d{3}[.]\d{3}\b|\b756[.]\d{4}[.]\d{4}[.]\d{2}\b

 

Spain

National identity number - Pattern(s): Matches a 8 digit number followed by a dash and a trailing letter.########-X

\b\d{8}-[a-zA-Z]\b

 

Taiwan

National identification number - Pattern(s): Matches a letter followed by 9 digits.

\b[a-zA-Z]\d{9}\b

 

Thailand

Population identification code - Pattern(s): Matches a 13 digit number separated by dashes.#-####-#####-##-#

\b\d{1}-\d{4}-\d{5}-\d{2}-\d\b

 

Turkey

Personal identification number - Pattern(s): Matches a 13 digit number.

\b\d{13}\b

 

United Kingdom

National health service number - Pattern(s): Matches a 10 digit number separated by dashes or the placeholder equivalent.###-###-#### or xxx-xxx-xxxx

\b\d{3}[-.]?\d{3}[-.]?\d{4}\b|xxx-xxx-xxxx

 

 

United States

 

Individual taxpayer identification number (ITIN) - Pattern(s): Matches a 9, followed by groupings of digits separated by dashes.9##-##-#### or 9xx-xx-xxxx

\b9\d{2}[-.]?\d{2}[-.]?\d{4}\b|9xx-xx-xxxx

Employer identification number (EIN) - Pattern(s): Matches 2 digits followed by a dash and 7 trailing digits.##-#######

\b\d{2}[-.]?\d{7}\b|xx-xxxxxxx

 

Vietnam

National identification number - Pattern(s): Matches a 9 digit number in groupings of 3 separated by dashes.###-###-###

\b\d{3}[-.]?\d{3}[-.]?\d{3}\b|xxx-xxx-xxx

 

 

European Union VAT ID Numbers

The following patterns match types of information that many countries consider to be personally identifiable.

Austria - Pattern(s): Matches ATU + 8 digits.

\bATU\d{8}\b|U\d{8}

Belgium - Pattern(s): Matches BE + 10 digits.

\bBE\d{10}\b|\d{10}

Bulgaria - Pattern(s): Matches BG + 9 to 10 digits.

\bBG\d{9,10}\b|\d{9,10}

Croatia - Pattern(s): Matches HR + 11 digits.

\bHR\d{11}\b|\d{11}

Cyprus - Pattern(s): Matches CY + 8 digits + 1 trailing character.

\b(cy|CY)?\d{8}\w\b

Czech Republic - Pattern(s): Matches CZ + 8 to 10 digits.

\b(cz|CZ)?\d{8,10}\b

Denmark - Pattern(s): Matches DK + 8 digits.

\b(dk|DK)?\d{8}\b

Estonia - Pattern(s): Matches EE + 9 digits.

\b(ee|EE)?\d{9}\b

Finland - Pattern(s): Matches FI + 8 digits.

\b(fi|FI)?\d{8}\b

France - Pattern(s): Matches FR + 2 characters followed by 9 digits.

\b(fr|FR)?[a-zA-Z]{2}\d{9}\b

Germany - Pattern(s): Matches DE + 9 digits.

\b(de|DE)?\d{9}\b

Greece - Pattern(s): Matches EL + 9 digits.

\b(el|EL)?\d{9}\b

Hungary - Pattern(s): Matches HU + 8 digits.

\b(hu|HU)?\d{8}\b

Ireland - Pattern(s): Matches IE + 7 digits followed by 1 or two characters.

\b(ie|IE)?\d{7}[a-zA-Z]{1,2}\b

Italy - Pattern(s): Matches IT + 11 digits.

\b(yit|IT)?\d{11}\b

Latvia - Pattern(s): Matches LV + 11 digits.

\b(lv|LV)?\d{11}\b

Lithuania - Pattern(s): Matches LT + 9 or 12 digits.

\b(lt|LT)?\d{9}\b|LT\d{12}

Luxembourg - Pattern(s): Matches LU + 8 digits.

\b(lu|LU)?\d{8}\b

Malta - Pattern(s): Matches MT + 8 digits.

\b(mt|MT)?\d{8}\b

Netherlands - Pattern(s): Matches NL + 9 digits followed by the letter B and 2 more digits.

\b(nl|NL)?\d{9}B\d{2}\b

Poland - Pattern(s): Matches PL + 10 digits. ###-###-##-## or ###-##-##-###.

\b(pl|PL)?\s\d{3}-\d{3}-\d{2}-\d{2}\b|PL\s\d{3}-\d{2}-\d{2}-\d{3}

Portugal - Pattern(s): Matches PT + 9 digits.

\b(pt|PT)?\d{9}\b

Romania - Pattern(s): Matches RO + 2 to 10 digits.

\b(ro|RO)?\d{2,10}\b

Slovakia - Pattern(s): Matches SK + 10 digits.

\b(sk|SK)?\d{10}\b

Slovenia - Pattern(s): Matches SI + 8 digits.

\b(si|SI)?\d{8}\b

Spain - Pattern(s): Matches ES + a character or a digit followed by 7 digits and a final character or a digit.

\b(es|ES)?[a-zA-Z0-9]\d{7}[a-zA-Z0-9]\b

Sweden - Pattern(s): Matches SE + 10 digits followed by 01.

\b(se|SE)?\d{10}01\b

 

 


United Kingdom

Standard - Pattern(s): Matches GB + 9 digits separated in groupings of 3, 4 and 2.GB### #### ##

\b(gb|GB)?\d{3}\s\d{4}\s\d{2}\b

Branch Traders - Pattern(s): Matches GB + 9 digits then a following block of 3 digits.GB######### ###

\b(gb|GB)?\d{9}\s\d{3}\b

Government Departments - Pattern(s): Matches GBGD + 3 digits.

\b(gbgd|GBGD)?d{3}\b

Health Authorities - Pattern(s): Matches GBHA + 3 digits.

\b(gbha|GBHA)?\d{3}\b