Predefined regular expressions

book

Article ID: 179480

calendar_today

Updated On:

Products

Messaging Gateway

Issue/Introduction

 

Resolution

Predefined regular expressions

Table: Regular expressions and associated templates describes the regular expressions that you can use in content filtering policy conditions.

See Expressions for content filtering policy conditions.

Table: Regular expressions and associated templates

Regular expression rule name

Description

Example

Associated template

ABA Routing Numbers

Any digit other than a 4, 5 or 9 followed by any 8 digits.

0123465789

222222222

841471235

Customer Data Protection; Employee Data Protection; PIPEDA; State Data Privacy

CA Drivers License Numbers

Any sequence of a letter followed by 7 digits, immediately preceded and succeeded by a character that is not a letter, a digit, or underscore (_).

a1234567

A1234567

State Data Privacy

Canadian Social Insurance Numbers

Matches numbers in the form DDD-DDD-DDD or DDD DDD DDD

123-456-789

123 456 789

PIPEDA; Canadian Social Insurance Number

C Source Code

The sequence #include, followed by any number of spaces, followed by a '<' or ", followed by any number of letters, digits or underscores, followed by a < or ".

#include lt;stdio.h>

#include "fdfdfd"

Source Code

Drivers License Keywords

Looks for combinations of driv followed by characters followed by lic followed by characters OR dl # or dl# OR lic # or lic# all case insensitive.

Driver License

Driver License

dl #

DL#

State Data Privacy

Drug Codes

Matches NDC Drug Code format http://www.fda.gov/cder/ndc/

12345-1234-12

HIPAA (including PHI)

/etc/passwd Format

Looks for sequences that match an /etc/passwd format.

bob:fdshfjhf:78978:45:fdsf:

Password Files

/etc/shadow Format

Looks for sequences that match an /etc/shadow format.

bob:fdsfd:​343:​45454: 4343:​122:​343:​545

Password Files

GoToMyPC Activity

Looks for a case insensitive match of the sequence 'jedi?request=' or '/erc/Poll?machinekey'

jedi?request=

/erc/Poll?machinekey

Network Security

IL Drivers License Numbers

Any sequence of a letter followed by 11 digits, immediately preceded and succeeded by a character that is not a letter, a digit, or underscore (_).

a12346578901

A12345678901

State Data Privacy

IP Address

Looks for a case insensitive match of the sequence 'IP Address.'

IP Address

ip address

iP aDdress

Network Diagrams

Java Class Files

Optional public, private or protected followed by class or interface followed a class name by an optional extends or implements followed by a class name.

public class Foo

protected class Bar

implements Foo

Source Code

Java Import Statements

Looks for import followed by a class name followed by a semicolon.

import

java.util.Collection;

Source Code

Java Source Code

Looks for the file name extensions "java"

stop_spam.java

Source Code

NY Drivers License Numbers

Any sequence of 9 digits, immediately preceded and succeeded by a character that is not a letter, a digit, or underscore (_).

123456789

987654321

State Data Privacy

Letter + 12 Digits Drivers License Numbers

Any sequence of a letter followed by 12 digits, immediately preceded and succeeded by a character that is not a letter, a digit, or underscore (_).

a123456789012

A123456789012

State Data Privacy

NJ Drivers License Numbers

Any sequence of a letter followed by 13 digits, immediately preceded and succeeded by a character that is not a letter, a digit, or underscore (_).

a1234567890123

A1234567890123

State Data Privacy

SAM Passwords

Looks for sequences that match a SAM passwords format.

bob:3434:​12345678​9012345​67890123​456798012:​123456​7890123456​7890123​45679​8012:

Password Files

PERL Keywords

A case sensitive match of the sequence 'perl'

perl

Source Code

PERL indicator

Looks for the sequence #!

#!

Source Code

PERL variable

Looks for sequences that start with a $ followed by any letter or underscore then followed by any number of letters, digits or underscore.

$something;

$another;

Source Code

S/MIME

Looks for MIME-type that begins with application/pkcs7-mime or application/x-pkcs7-mime or application/pkcs7-signature or application/x-pkcs7-signature

example.p7c

example.p7m

example.p7s

example.p7a

Encrypted Data

SWIFT Code Regex

4 characters followed by a dash followed by 2 characters followed dash followed by 2 characters followed by an optional dash and 2 characters.

ABCD-EF-GH

ABCD-EF-GH-IJK

Swift Codes

UK Drivers License Numbers

5 characters or digits followed by a digit followed by one of the inner groupings followed by a digit followed by 3 characters or digits followed by 2 characters.

A1234501023​ABCDE

UK Drivers License Numbers

UK Electoral Roll Numbers

Two or three upper case letters, followed by one to four digits, immediately preceded and succeeded by a character that is not a letter, a digit, or underscore (_).

AB1

AB12

AB123

AB1234

ABC1

ABC1234

UK Electoral Roll Numbers; Human Rights Act 1998

UK National Insurance Number

Two upper case letters from the group A-CEGHJ-NOPR-TW-Z followed by 6 digits, followed by an optional upper case letter (A through D), immediately preceded and succeeded by a character that is not a letter, a digit, or underscore (_).

AB123456

AB132456C

UK National Insurance Number; Caldicott Report

UK Passport Numbers (Old Type)

An upper case letter or digit, followed by 4 digits, followed by an upper case letter or digit, immediately preceded and succeeded by a character that is not a letter, a digit, or underscore (_).

A1234B

12345C

132456

A12345

UK Passport Numbers; Data Protection Act 1998

UK Passport Numbers (New Type)

Any sequence of 9 digits, immediately preceded and succeeded by a character that is not a letter, a digit, or underscore (_).

A1234B

12345C

132456

A12345

UK Passport Numbers; Data Protection Act 1998

UK Tax ID Numbers

Any sequence of 10 digits, immediately preceded and succeeded by a character that is not a letter, a digit, or underscore (_).

AB123456

AB132456C

UK Tax ID Numbers

US ITIN

Looks for a 9 followed by 2 digits, followed by a dash, followed by a 7 or 8 followed by a digit, followed by a dash, followed by any four digits, immediately preceded and succeeded by a character that is not a letter, a digit, or underscore (_).

912-71-1234

902-81-0234

Individual Taxpayer Identification Numbers (ITIN)

VB Source Code

A case sensitive match of the sequence Attribute followed by a space character followed by VB_Name.

Attribute VB_Name

Source Code

Filename

Looks for a true file type that mataches the type identified in the associated template.

True file type is PGP Secret Keyring

Password Files; Encrypted Data