Was this helpful?
Matches Pattern
 
Rule
MatchesPattern
Default Rule Name
<fieldname>_MatchesPattern
Description
Checks whether a field value matches a regular Java expression. Values that match the selected pattern are written to the Pass Target. Values that do not match the selected pattern are written to the Fail Target.
Rule Parameters
Regex Pattern: Select from the following list:
12 Hour Time Format
24 Hour Time Format
AlphaNumeric Strings
AnyString
ASCII characters only
Canada Postal Code
Canada Social Insurance Number
Credit Card Number
Days of Week
Digits Only
Email Address
Germany Postal Code
Germany Phone Number
Germany Sozialversicherungsnummer
India Postal Code
India Phone Number
India Aadhaar Number
Ip4 Address
ISBN_10 Number
Mr Or Mrs
Printable Characters
Single Alphabetic Character
UK Postal Code
UK Phone Number
UK National Insurance Number
US Currency
US Phone Number
US Social Security Number
US Standard Date Format
US Zipcode
Vehicle Identification Number
YYMMDD Date Format
For a description of Regex Pattern options, see Remarks.
Supported Data Types
String
Remarks
Listed below are the regular Java expressions for Regex Pattern options:
12 Hour Time Format - ^ *(1[0-2]|0?[1-9]):[0-5][0-9] *(a|p|A|P)(m|M) *$
24 Hour Time Format - (([0-1][0-9])|([2][0-3])):([0-5][0-9]):([0-5][0-9])
AlphaNumeric Strings - ^[a-zA-Z0-9]+$
AnyString - .*
ASCII characters only - ^([a-zA-Z0-9!\"#$%&',/:;<=>@_`|~ \\(\\)\\\\+\\-\\.\\?\\[\\]\\\\\\^\\{\\}])$
Canada Postal Code - ^([A-Za-z]\\d[A-Za-z][\\s-]?\\d[A-Za-z]\\d)
Canada Social Insurance Number - ^(\\d{3}-\\d{3}-\\d{3})|(\\d{9})$
Credit Card Number - ^[1-9][0-9]{3}(\\s?|-?)[0-9]{4}\\1[0-9]{4}\\1[0-9]{4}$
Days of Week - ^(?i)(Sun|Mon|(T(ues|hurs))|Fri)(day|\\.)?$|Wed(\\.|nesday)?$|Sat(\\.|urday)?$|T((ue?)|(hu?r?))\\.?$
Digits Only - ^\\d+$"
Email Address - ^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\\-+)|([A-Za-z0-9]+\\.+)|([A-Za-z0-9]+\\++))[A-Za-z0-9]+@((\\w+\\-+)|(\\w+\\.))\\w{1,63}\\.[a-zA-Z]{2,63}$
Germany Postal Code - ^[0-9]{5}$
Germany Phone Number - ^((((00|\\+)?49[- .]?|0)(((\\d{2,3})([- .]?\\d{4}){2})|((\\d{4})([- .]?\\d{3})([- .]?\\d{4}))|((3\\d{4})([- .]?\\d{2})([- .]?\\d{4}))|(((15\\d{2})|(16\\d)|(17\\d))([- .]?\\d{3})([- .]?\\d{4}))))|(((00|\\+)?49[- .]?\\(|\\(0)(((\\d{2,3}\\))([- .]?\\d{4}){2})|((\\d{4}\\))([- .]?\\d{3})([- .]?\\d{4}))|((3\\d{4}\\))([- .]?\\d{2})([- .]?\\d{4}))|(((15\\d{2})|(16\\d)|(17\\d))([- .]?\\d{3})([- .]?\\d{4})))))$
Germany Sozialversicherungsnummer - ^[0-9]{2}(\\s?|-?)[0-9]{2}[0,1][0-9][0-9]{2}\\1[A-Z]\\1[0-9]{2}[0-9]$
India Postal Code - ^[0-9]{6}$
India Phone Number - ^(((((00|\\+)?91[- .]?)|0)(((\\d{2})([- .]?\\d{8}))|((\\d{3})([- .]?\\d{7}))|((\\d{4})([- .]?\\d{6}))))|((((00|\\+)?91[- .]?\\()|\\(0)(((\\d{2}\\))([- .]?\\d{8}))|((\\d{3}\\))([- .]?\\d{7}))|((\\d{4}\\))([- .]?\\d{6}))))|(((00|\\+)?91[- .])?(\\d{4}[- .]?){2}(\\d{2})))$
India Aadhaar Number - ^[2-9]{1}[0-9]{3}\\s*-?[0-9]{4}\\s*-?[0-9]{4}$
Ip4 Address - ^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}$
ISBN_10 Number - ^(?:ISBN(?:-1[03])?:? )?(?=[0-9X]{10}$|(?=(?:[0-9]+[- ]){3})[- 0-9X]{13}$|97[89][0-9]{10}$|(?=(?:[0-9]+[-\n]){4})[- 0-9]{17}$)(?:97[89][- ]?)?[0-9]{1,5}[- ]?[0-9]+[-\n]?[0-9]+[- ]?[0-9X]$
Mr or Mrs - ^Mr$|^Mrs$
Printable Characters - ^([a-zA-Z0-9\\s!@#$%^&*()_=+;:'\"|~`<>?/{}-]+)$
 
Single Alphabetic Character - ^[a-zA-Z]$
UK Postal Code - ^([A-Z]{1,2}[0-9]{1,2}|[A-Z]{3}|[A-Z]{1,2}[0-9][A-Z])( |-)[0-9][A-Z]{2}
UK Phone Number - ^(((((00|\\+)?44[- .]?)|0)(((2\\d)([- .]?\\d{4}){2})|(((11\\d)|(1\\d1))([- .]?\\d{3})([- .]?\\d{4}))|((1\\d{3})([- .]?\\d{2})([- .]?\\d{3,4}))|((\\d{5})([- .]?\\d{2})([- .]?\\d{3}))|((\\d{5})([- .]?\\d{4,5}))))|((((00|\\+)?44[- .]?\\()|\\(0)(((2\\d\\))([- .]?\\d{4}){2})|(((11\\d\\))|(1\\d1\\)))([- .]?\\d{3})([- .]?\\d{4}))|((1\\d{3}\\))([- .]?\\d{2})([- .]?\\d{3,4}))|((\\d{5}\\))([- .]?\\d{2})([- .]?\\d{3}))|((\\d{5}\\))([- .]?\\d{4,5})))))$
UK National Insurance Number - ^([ACEHJLMOPRSW-Yacehjlmoprsw-y][A-CEGHJ-NPRSTW-Za-ceghj-nprstw-z]|[Bb][A-CEHJ-NPRSTW-Za-cehj-nprstw-z]|[Gg][ACEGHJ-NPRSTW-Zaceghj-nprstw-z]|[Kk][A-CEGHJ-MPRSTW-Za-ceghj-mprstw-z]|[Nn][A-CEGHJLMNPRSW-Za-ceghjlmnprsw-z]|[Tt][A-CEGHJ-MPRSTW-Za-ceghj-mprstw-z]|[Zz][A-CEGHJ-NPRSTW-Ya-ceghj-nprstw-y])(\\s?|-?)[0-9]{2}\\2[0-9]{2}\\2[0-9]{2}\\2[A-Da-d ]?$
US Currency - ^\\$\\d*(.\\d{1,2})?$
US Phone Number - ^((\\+?1[- .]?)?((\\([2-9]\\d{2}\\))|([2-9]\\d{2}))[- .]??[2-9]\\d{2}[- .]?\\d{4})$
US Social Security Number - ^[0-9]{3}-?[0-9]{2}-?[0-9]{4}$
US Standard Date Format - ^([0]\\d|[1][0-2])\\/([0-2]\\d|[3][0-1])\\/([2][01]|[1][6-9])\\d{2}(\\s([0-1]\\d|[2][0-3])(\\:[0-5]\\d){1,2})?$
US Zipcode - ^[0-9]{5}(-[0-9]{4})?$
Vehicle Identification Number - ^(([a-h,A-H,j-n,J-N,p-z,P-Z,0-9]{9})([a-h,A-H,j-n,J-N,p,P,r-t,R-T,v-z,V-Z,0-9])([a-h,A-H,j-n,J-N,p-z,P-Z,0-9])(\\d{6}))$
YYMMDD Date Format - ^((\\d{2}((0[13578]|1[02])(0[1-9]|[12]\\d|3[01])|(0[13456789]|1[012])(0[1-9]|[12]\\d|30)|02(0[1-9]|1\\d|2[0-8])))|([02468][048]|[13579][26])0229)$
 
Last modified date: 10/30/2024