Adding URL Regular Expression Exceptions

Follow

Using Regular Expressions you can create exceptions to URL Regular Expression filtering rules. 

A Regular Expression, often called a pattern, is an expression that describes a set of strings. When URL regular expressions have been defined, Sonar searches for patterns in the text of a URL and blocks or allows the request if it finds such a pattern. For example, the regular expression (video) in a URL Regular Expression filter will block any webpage has the pattern "video" in the URL. The string would then deny anything from:

You can broaden the expressions to include (vids) as in ((vids)\(video)) to block sites whose URLs contain the string "vids" or the word "video". 

AN EXAMPLE
A good example of creating an exception to URL regular expression filtering is allowing a certain video on YouTube to be viewed. A significant number of organisations will have this page blocked by default. But YouTube also hosts lots of legitimate and relevant videos. By creating a regular expression exception, you can unblock individual videos while keeping the rest of the site blocked.

For example, you want to enable students to watch a high-speed, high definition video of a hummingbird feeding which has the following URL: http://www.youtube.com/watch?v=qVOhuCl7DDE 

We don't need the full URL in the regular expression, just the bit that identifies this particular video, which is the string following "v=" In the regular expression you must include the video ID in brackets.

HOW TO CREATE URL REGULAR EXPRESSION EXCEPTIONS

  1. Double-click Sonar -> Groups -> Rules -> HTTP and click the URL Reg. Exp Exception ellipsis button [...]
  2. In the Maintain Group Expressions window that is displayed, create a new exception category by clicking Add New. Enter a name for the category and click OK. Because URL regular expression categories are not just listed for the exceptions but for the URL regular express filtering as well, make sure the category name is descriptive.
  3. You can enter the regular expression directly in the editor window, or you can copy and paste text from another editor into the window. Each new expression must be placed on a new line. 
  4. Click Apply and Close. Then add the new category as an exception by selecting the category in the left column and clicking >> button.
Have more questions? Submit a request

Comments

Powered by Zendesk