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 URL's contain the string "vids" or the word "video".


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 hummingbird feeding which has the following URL:

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


  1. Double-Click Sonar->Groups->Rules->HTTP and click the URL Reg.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 he regular expression directly in the editor window, or you can copy and paste test 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.