Open Frames Download Complete PDF Send Feedback Print This Page


Regular Expressions

In This Appendix

Regular Expression Syntax

Using Regular Expressions in Custom Sites

Using Non-Printable Characters

Using Character Types

Regular Expression Syntax

This table shows the Check Point implementation of standard regular expression metacharacters.






escape metacharacters

non-printable characters

character types

[ ]

Square Brackets

character class definition

( )


subpattern, to use metacharacters on the enclosed string


Curly Brackets

min/max quantifier

{n} - exactly n occurrences

{n,m} - from n to m occurrences

{n,} - at least n occurrences



match any character


Question Mark

zero or one occurrences (equals {0,1})



zero or more occurrences of preceding character


Plus Sign

one or more occurrences (equals {1,})


Vertical Bar




anchor pattern to beginning of buffer (usually a word)



anchor pattern to end of buffer (usually a word)



range in character class

Using Regular Expressions in Custom Sites

Select URLs are defined as Regular Expression only if the application or site URL is entered as a regular expression using the correct syntax.

The meaning of the asterisk ( * ) depends on its use.

  • In regular expressions, the asterisk is a metacharacter for zero or more instances of the preceding character.
  • Without regular expressions, the asterisk is a wildcard, for zero or more instances of any character.

For example, to block a domain that ends with "" (such as

Regular Expression





Important! If you use this string as a regular expression, policy install fails. The gateway cannot resolve the regular expression to a URL, because there is no preceding character to find.

More examples of regular expressions:

To match subdomains of (^|.*\.)mydomain\.com

To match domain and subdomains of (^|.*\.)*mydomain\.com

Using Non-Printable Characters

To use non-printable characters in patterns, escape the reserved character set.




alarm; the BEL character (hex 07)


"control-x", where x is any character


escape (hex 1B)


formfeed (hex 0C)


newline (hex 0A)


carriage return (hex 0D)


tab (hex 09)


character with octal code ddd


character with hex code hh

Using Character Types

To specify types of characters in patterns, escape the reserved character.




any decimal digit [0-9]


any character that is not a decimal digit


any whitespace character


any character that is not whitespace


any word character (underscore or alphanumeric character)


any non-word character (not underscore or alphanumeric)

Top of Page ©2015 Check Point Software Technologies Ltd. All rights reserved. Download PDF Send Feedback Print