Skip to main content

Regular expression reference

Use this table, and the examples below, for reference when creating application exclusions:

Effect

Pattern

Example pattern

Example match

Start of a string

^

^w+

Start of a string

End of a string

$

w+$

End of a string

Case-insensitive match of following string

(?i)

(?i)%0a

%0a or %0A

A single character of: a, b or c

[abc]

[abc]+

a bb ccc

A character except: a, b or c

[^abc]

[^abc]+

Anythingbutabc.

A character in the range: a-z

[a-z]

[a-z]+

Only a-z

A character not in the range: a-z

[^a-z]

[^a-z]+

Anythingbuta-z.

A character in the range of: a-z or A-Z

[a-zA-Z]

[a-zA-Z]+

abc123DEF

Any single character

.

.+

abc

Any whitespace character

\s

\s

anywhitespacecharacter

Any non-whitespace character

\S

\S+

any non-whitespace

Any digit

\d

\d

not 1 not 2

Any non-digit

\D

\D+

not 1 not 2

Zero or one of a

a?

ba?

ba b a

Zero or more of a

a*

ba*

ba baa aaa ba b

One or more of a

a+

a+

a aa aaa aaaa bab baab

Exactly 3 of a

a{3}

a{3}

a aa aaa aaaa

3 or more of a

a{3,}

a{3,}

a aa aaa aaaa aaaaaa

Between 3 and 6 of a

a{3,6}

a{3,6}

a aa aaa aaaa aaaaaa aaaa

Period (dot) is a literal character

.

a.b

string.string