Cipafilter Support:
Support@Cipafilter.com
800.243.3729 ext 300
Mon - Fri 7 AM - 6 PM CT
Knowledgebase: Common Support Topics
REGEX - Managing Your Whitelist/Blacklist with Regular Expressions
Posted by , Last modified by Jim Giseburt on 30 November 2016 11:45 AM

Regular expressions (REGEX) are powerful when used in the whitelist or blacklist.  Regular expressions can be used to affect URLs containing a word, an IP address, part of a website, or an individual page on a website.

The format of regular expression statements is as follows:

REGEX:<domain>:<expression>

Notes

Global wild cards: Entering a single asterisk (*) for the domain field will apply the subsequent expression to all domains. This wild-card method is provided as a way for users to create global expressions if necessary; however, it is important to note that this does incur a performance hit to the content filter. How severe this performance hit is depends on the total number of wild-card entries, the amount of traffic being pushed through the unit, and several other factors.

Matching sub-domains: Entering a sub-domain into the domain field — for example, REGEX:accounts.youtube.com: — will not behave as expected, because contentfilter normalizes whatever is entered into this field into a 'top-level' domain name. In this case, the rule will apply to all youtube.com domains, not just to accounts.youtube.com. If you wish to apply a rule to a specific sub-domain, you will need to add the sub-domain to the expression field.

Examples

REGEX:*:porn

Match all URLs containing the word 'porn' on any site under any domain. (Please see the note about global wild-card entries above.)

REGEX:youtube.com:

Match all URLs on any site under the youtube.com domain.  Simply adding youtube.com to the whitelist or blacklist has the same effect and requires less typing.

REGEX:www.youtube.com:

Match all URLs on any site under the youtube.com domain (same as previous example). This illustrates how contentfilter strips sub-domains. (Please see the note about matching sub-domains above.)

REGEX:youtube.com:watch

Match all URLs containing the word 'watch' on any site under the youtube.com domain.

REGEX:youtube.com:^http://

Match all URLs on any HTTP site under the youtube.com domain.

REGEX:youtube.com:^https?://accounts\.youtube\.com

Match all URLs on accounts.youtube.com.

REGEX:*:^https?://[^/]+\.edu

Match all URLs with the Top Level Domain (TLD) of .edu

REGEX:*:((x)+.*(y)+)|((y)+.*(x)+)

Match all URLs containing any combination of two words, x and y.

Appendix

See http://www.regular-expressions.info/tutorial.html for an explanation of regular-expression syntax.

(1 vote(s))
Helpful
Not helpful

Comments (0)
©Cipafilter 2017. All Rights Reserved.