hmLoadTopic({
hmKeywords:"content filter,content filter rules,expressions,literals,metacharacters,Regular Expressions,tagged expressions,Using Regular Expressions",
hmTitle:"Using Regular Expressions in Your Filter Rules",
hmDescription:"The Content Filtering system supports regular expression searches, which is a versatile system that makes it possible for you to search not only for specific text strings, but...",
hmPrevLink:"cf_modifying_an_existing_content_filter.html",
hmNextLink:"cf_attachments.html",
hmParentLink:"cf_content_filter_editor.html",
hmBreadCrumbs:"<a href=\"security_menu.html\">Security Menu<\/a> &gt; <a href=\"cf_and_av.html\">Content Filter and AntiVirus<\/a> &gt; Content Filter Editor &gt; <a href=\"cf_content_filter_editor.html\">Rules<\/a>",
hmTitlePath:"Security Menu > Content Filter and AntiVirus > Content Filter Editor > Rules > Using Regular Expressions in Your Filter Rules",
hmHeader:"<h1 class=\"p_Heading1\" style=\"page-break-after: avoid;\"><span class=\"f_Heading1\">Using Regular Expressions in Your Filter Rules<\/span><\/h1>\n\r",
hmBody:"<p class=\"p_BodyText\"><span class=\"f_BodyText\">The Content Filtering system supports <\/span><span style=\"font-style: italic;\">regular expression<\/span><span class=\"f_BodyText\"> searches, which is a versatile system that makes it possible for you to search not only for specific text strings, but also for text <\/span><span style=\"font-style: italic;\">patterns<\/span><span class=\"f_BodyText\">. Regular expressions contain a mix of plain text and special characters that indicate what kind of matching to do, and can thus make your Content Filter rules more powerful and better targeted.<\/span><\/p>\n\r<h4 class=\"p_Heading4\" style=\"page-break-after: avoid;\"><span class=\"f_Heading4\">What are Regular Expressions?<\/span><\/h4>\n\r<p class=\"p_BodyText\"><span class=\"f_BodyText\">A regular expression (regexp) is a text pattern consisting of a combination of special characters known as <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic; color: #010100;\">metacharacters<\/span><span class=\"f_BodyText\"> and alphanumeric text characters, or &quot;<\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic; color: #010100;\">literals<\/span><span class=\"f_BodyText\">&quot; (abc, 123, and so on). The pattern is used to match against text strings—with the result of the match being either successful or not. Regexps are used primarily for regular text matches and for search and replace.<\/span><\/p>\n\r<p class=\"p_BodyText\"><span class=\"f_BodyText\">Metacharacters are special characters that have specific functions and uses within regular expressions. The regexp implementation within the MDaemon Content Filtering system allows the following metacharacters:<\/span><\/p>\n\r<p class=\"p_Code2_LastItem\"><span class=\"f_Code2_LastItem\">\\ | () [] ^ \$ * + ? . &lt;&gt;<\/span><\/p>\n\r<div style=\"text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0.5000rem 0 0.1875rem 0;\"><table style=\"border:none; border-spacing:0.2500rem;\">\n\r<tr>\n\r<td style=\"vertical-align:top; width:8.3125rem; padding:0; border:none\"><p class=\"p_BodyText_Center\"><span class=\"f_BodyText_Center\" style=\"font-weight: bold;\">Metacharacter<\/span><\/p>\n\r<\/td>\n\r<td style=\"vertical-align:top; width:26.1875rem; padding:0; border:none\"><p class=\"p_BodyText\"><span class=\"f_BodyText\" style=\"font-weight: bold;\">Description<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<tr>\n\r<td style=\"vertical-align:top; width:8.3125rem; padding:0; border:none\"><p class=\"p_BodyText_Center\"><span class=\"f_BodyText_Center\" style=\"font-weight: bold;\">\\<\/span><\/p>\n\r<\/td>\n\r<td style=\"vertical-align:top; width:26.1875rem; padding:0; border:none\"><p class=\"p_BodyText\"><span class=\"f_BodyText\">When used before a metacharacter, the backslash ( &quot;<\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold;\">\\<\/span><span class=\"f_BodyText\">&quot; ) causes the metacharacter to be treated as a literal character. This is necessary if you want the regular expression to search for one of the special characters that are used as metacharacters. For example, to search for &quot;+&quot; your expressions must include &quot;\\+&quot;.<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<tr>\n\r<td style=\"vertical-align:top; width:8.3125rem; padding:0; border:none\"><p class=\"p_BodyText_Center\"><span class=\"f_BodyText_Center\" style=\"font-weight: bold;\">|<\/span><\/p>\n\r<\/td>\n\r<td style=\"vertical-align:top; width:26.1875rem; padding:0; border:none\"><p class=\"p_BodyText\"><span class=\"f_BodyText\">The <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">alternation<\/span><span class=\"f_BodyText\"> character (also called &quot;<\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">or<\/span><span class=\"f_BodyText\">&quot; or &quot;<\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">bar<\/span><span class=\"f_BodyText\">&quot;) is used when you want either expression on the side of the character to match the target string. The regexp &quot;abc|xyz&quot; will match any occurrence of either &quot;abc&quot; or &quot;xyz&quot; when searching a text string.<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<tr>\n\r<td style=\"vertical-align:top; width:8.3125rem; padding:0; border:none\"><p class=\"p_BodyText_Center\"><span class=\"f_BodyText_Center\" style=\"font-weight: bold;\">[...]<\/span><\/p>\n\r<\/td>\n\r<td style=\"vertical-align:top; width:26.1875rem; padding:0; border:none\"><p class=\"p_BodyText\"><span class=\"f_BodyText\">A set of characters contained in brackets (&quot;[&quot; and &quot;]&quot;) means that any character in the set may match the searched text string. A dash (&quot;-&quot;) between characters in the brackets denotes a range of characters. For example, searching the string &quot;abc&quot; with the regexp &quot;[a-z]&quot; will yield three matches: &quot;<\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">a<\/span><span class=\"f_BodyText\">,&quot; &quot;<\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">b<\/span><span class=\"f_BodyText\">, &quot; and &quot;<\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">c<\/span><span class=\"f_BodyText\">. &quot; Using the expression &quot;[az]&quot; will yield only one match: &quot;<\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">a<\/span><span class=\"f_BodyText\">.&quot;<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<tr>\n\r<td style=\"vertical-align:top; width:8.3125rem; padding:0; border:none\"><p class=\"p_BodyText_Center\"><span class=\"f_BodyText_Center\" style=\"font-weight: bold;\">^<\/span><\/p>\n\r<\/td>\n\r<td style=\"vertical-align:top; width:26.1875rem; padding:0; border:none\"><p class=\"p_BodyText\"><span class=\"f_BodyText\">Denotes the beginning of the line. In the target string, &quot;abc ab a&quot; the expression &quot;^a&quot; will yield one match—the first character in the target string. The regexp &quot;^ab&quot; will also yield one match—the first <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">two<\/span><span class=\"f_BodyText\"> characters in the target string.<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<tr>\n\r<td style=\"vertical-align:top; width:8.3125rem; padding:0; border:none\"><p class=\"p_BodyText_Center\"><span class=\"f_BodyText_Center\" style=\"font-weight: bold;\">[^...]<\/span><\/p>\n\r<\/td>\n\r<td style=\"vertical-align:top; width:26.1875rem; padding:0; border:none\"><p class=\"p_BodyText\"><span class=\"f_BodyText\">The caret (&quot;^&quot;) immediately following the left-bracket (&quot;[&quot;) has a different meaning. It is used to exclude the remaining characters within brackets from matching the target string. The expression &quot;[^0-9]&quot; indicates that the target character should not be a digit.<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<tr>\n\r<td style=\"vertical-align:top; width:8.3125rem; padding:0; border:none\"><p class=\"p_BodyText_Center\"><span class=\"f_BodyText_Center\" style=\"font-weight: bold;\">(...)<\/span><\/p>\n\r<\/td>\n\r<td style=\"vertical-align:top; width:26.1875rem; padding:0; border:none\"><p class=\"p_BodyText\"><span class=\"f_BodyText\">The parenthesis affects the order of pattern evaluation, and also serves as a <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">tagged<\/span><span class=\"f_BodyText\"> expression that can be used in <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">search and replace<\/span><span class=\"f_BodyText\"> expressions.<\/span><\/p>\n\r<p class=\"p_BodyText\"><span class=\"f_BodyText\">The results of a search with a regular expression are kept temporarily and can be used in the <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">replace<\/span><span class=\"f_BodyText\"> expression to build a new expression. In the <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">replace<\/span><span class=\"f_BodyText\"> expression, you can include a &quot;\$0&quot; character, which will be replaced by the sub-string found by the regular expression during the search. So, if the <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">search<\/span><span class=\"f_BodyText\"> expression &quot;a(bcd)e&quot; finds a sub-string match, then a <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">replace<\/span><span class=\"f_BodyText\"> expression of &quot;123-\$0-123&quot; will replace the matched text with &quot;123-abcde-123&quot;.<\/span><\/p>\n\r<p class=\"p_BodyText\"><span class=\"f_BodyText\">Similarly, you can also use the special characters &quot;\$1,&quot; &quot;\$2,&quot; &quot;\$3,&quot; and so on in the <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">replace<\/span><span class=\"f_BodyText\"> expression. These characters will be replaced only be the results of the <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">tagged<\/span><span class=\"f_BodyText\"> expression instead of the entire sub-string match. The number following the backslash denotes which tagged expression you wish to reference (in the case of a regexp containing more than one tagged expression). For example, if your <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">search<\/span><span class=\"f_BodyText\"> expression is &quot;(123)(456)&quot; and your <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">replace<\/span><span class=\"f_BodyText\"> expression is &quot;a-\$2-b-\$1&quot; then a matching sub-string will be replaced with &quot;a-456-b-123&quot; whereas a <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">replace<\/span><span class=\"f_BodyText\"> expression of &quot;a-\$0-b&quot; will be replaced with &quot;a-123456-b&quot;<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<tr>\n\r<td style=\"vertical-align:top; width:8.3125rem; padding:0; border:none\"><p class=\"p_BodyText_Center\"><span class=\"f_BodyText_Center\" style=\"font-weight: bold;\">\$<\/span><\/p>\n\r<\/td>\n\r<td style=\"vertical-align:top; width:26.1875rem; padding:0; border:none\"><p class=\"p_BodyText\"><span class=\"f_BodyText\">The dollar sign (&quot;\$&quot;) denotes the end of the line. In the text string, &quot;13 321 123&quot; the expression &quot;3\$&quot; will yield one match—the last character in the string. The regexp &quot;123\$&quot; will also yield one match—the last <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">three<\/span><span class=\"f_BodyText\"> characters in the target string.<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<tr>\n\r<td style=\"vertical-align:top; width:8.3125rem; padding:0; border:none\"><p class=\"p_BodyText_Center\"><span class=\"f_BodyText_Center\" style=\"font-weight: bold;\">*<\/span><\/p>\n\r<\/td>\n\r<td style=\"vertical-align:top; width:26.1875rem; padding:0; border:none\"><p class=\"p_BodyText\"><span class=\"f_BodyText\">The asterisk (&quot;*&quot;) quantifier indicates that the character to its left must match <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">zero or more<\/span><span class=\"f_BodyText\"> occurrences of the character in a row. Thus, &quot;1*abc&quot; will match the text &quot;111abc&quot; and &quot;abc.&quot;<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<tr>\n\r<td style=\"vertical-align:top; width:8.3125rem; padding:0; border:none\"><p class=\"p_BodyText_Center\"><span class=\"f_BodyText_Center\" style=\"font-weight: bold;\">+<\/span><\/p>\n\r<\/td>\n\r<td style=\"vertical-align:top; width:26.1875rem; padding:0; border:none\"><p class=\"p_BodyText\"><span class=\"f_BodyText\">Similar to the asterisk quantifier, the &quot;+&quot; quantifier indicates that the character to its left must match <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">one or more<\/span><span class=\"f_BodyText\"> occurrences of the character in a row. Thus, &quot;1+abc&quot; will match the text &quot;111abc&quot; but not &quot;abc.&quot;<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<tr>\n\r<td style=\"vertical-align:top; width:8.3125rem; padding:0; border:none\"><p class=\"p_BodyText_Center\"><span class=\"f_BodyText_Center\" style=\"font-weight: bold;\">?<\/span><\/p>\n\r<\/td>\n\r<td style=\"vertical-align:top; width:26.1875rem; padding:0; border:none\"><p class=\"p_BodyText\"><span class=\"f_BodyText\">The question mark (&quot;?&quot;) quantifier indicates that the character to its left must match <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">zero or one<\/span><span class=\"f_BodyText\"> times.<\/span><br \/>\n\r<span class=\"f_BodyText\">Thus, &quot;1?abc&quot; will match the text &quot;abc,&quot; and it will match the &quot;1abc&quot; portion of &quot;111abc.&quot;<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<tr>\n\r<td style=\"vertical-align:top; width:8.3125rem; padding:0; border:none\"><p class=\"p_BodyText_Center\"><span class=\"f_BodyText_Center\" style=\"font-weight: bold;\">.<\/span><\/p>\n\r<\/td>\n\r<td style=\"vertical-align:top; width:26.1875rem; padding:0; border:none\"><p class=\"p_BodyText\"><span class=\"f_BodyText\">The period or dot (&quot;.&quot;) metacharacter will match any other character. Thus &quot;.+abc&quot; will match &quot;123456abc,&quot; and &quot;a.c&quot; will match &quot;aac,&quot; abc,&quot; acc,&quot; and so on.<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r<p class=\"p_ControlHeading\" style=\"page-break-after: avoid;\"><span class=\"f_ControlHeading\">Eligible Conditions and Actions<\/span><\/p>\n\r<p class=\"p_ControlIndent\"><span class=\"f_ControlIndent\">Regular expressions may be used in any <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic; color: #010100;\">Header<\/span><span class=\"f_ControlIndent\"> filter rule <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic; color: #010100;\">Condition<\/span><span class=\"f_ControlIndent\">. For example, any rule using the &quot;<\/span><span style=\"font-size: 1.10rem; font-family: \'Courier New\',Courier,monospace; color: #010100;\">if the FROM HEADER contains<\/span><span class=\"f_ControlIndent\">&quot; condition. Regular expressions may also be used in the &quot;<\/span><span style=\"font-size: 1.10rem; font-family: \'Courier New\',Courier,monospace; color: #010100;\">if the MESSAGE BODY contains<\/span><span class=\"f_ControlIndent\">&quot; condition.<\/span><\/p>\n\r<p class=\"p_ControlIndent\"><span class=\"f_ControlIndent\">Regular expressions may be used in two Content Filter rule <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic; color: #010100;\">Actions<\/span><span class=\"f_ControlIndent\">: &quot;<\/span><span style=\"font-size: 1.10rem; font-family: \'Courier New\',Courier,monospace; color: #010100;\">Search and Replace Words in a Header<\/span><span class=\"f_ControlIndent\">&quot; and &quot;<\/span><span style=\"font-size: 1.10rem; font-family: \'Courier New\',Courier,monospace; color: #010100;\">Search and Replace Words in the Message Body<\/span><span class=\"f_ControlIndent\">.&quot;<\/span><\/p>\n\r<div style=\"text-align: left; text-indent: 0; padding: 0 0 0 0; margin: 0 3.0625rem 0.8750rem 3.0000rem;\"><table style=\"background-color:#ffffe6; border:solid thin #000000; border-spacing:0;\">\n\r<tr>\n\r<td style=\"vertical-align:top; width:3.1250rem; height:3.1250rem; padding:0.3125rem; border:none\"><p class=\"p_NoFormat\"><img style=\"margin:0;width:3.1250rem;height:3.1250rem;border:none\" src=\".\/images\/lightbulb_on_50_yback.gif\"\/><\/p>\n\r<\/td>\n\r<td style=\"vertical-align:top; padding:0.3125rem; border:none\"><p class=\"p_Notes\"><span class=\"f_Notes\">Regular expressions used in Content Filter rule <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">conditions<\/span><span class=\"f_Notes\"> are case insensitive. Case will not be considered.<\/span><\/p>\n\r<p class=\"p_Notes\"><span class=\"f_Notes\">Case sensitivity in regular expressions used in Content Filter rule <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic;\">actions<\/span><span class=\"f_Notes\"> is optional. When creating the regexp within the rule<\/span><span style=\"font-family: \'Times New Roman\',Times,Georgia,serif;\">\'<\/span><span class=\"f_Notes\">s action you will have the option to enable\/disable case sensitivity.<\/span><\/p>\n\r<\/td>\n\r<\/tr>\n\r<\/table>\n\r<\/div>\n\r<p class=\"p_DialogSectionHeading\" style=\"page-break-after: avoid;\"><span class=\"f_DialogSectionHeading\">Configuring a Regexp in a Rule\'s Condition<\/span><\/p>\n\r<p class=\"p_ControlIndent\"><span class=\"f_ControlIndent\">To configure a header or message body condition to use a regular expression:<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">1.<\/span><span class=\"f_ControlIndent\">On the Create Rule dialog, click the checkbox that corresponds to the header or message body condition that you wish to insert into your rule.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">2.<\/span><span class=\"f_ControlIndent\">In the summary area at the bottom of the Create Rule dialog, click the &quot;<\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold; color: #010100;\">contains specific strings<\/span><span class=\"f_ControlIndent\">&quot; link that corresponds to the condition that you selected in step 1. This will open the Specify Search Text dialog.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">3.<\/span><span class=\"f_ControlIndent\">Click the &quot;<\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold; color: #010100;\">contains<\/span><span class=\"f_ControlIndent\">&quot; link in the &quot;Currently specified strings...&quot; area.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">4.<\/span><span class=\"f_ControlIndent\">Choose &quot;<\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold; color: #010100;\">Matches Regular Expression<\/span><span class=\"f_ControlIndent\">&quot; from the drop-down list box, and click <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold; color: #010100;\">OK<\/span><span class=\"f_ControlIndent\">.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">5.<\/span><span class=\"f_ControlIndent\">If you need help creating your regexp or want to test it then click &quot;<\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold; color: #010100;\">Test regular expression<\/span><span class=\"f_ControlIndent\">.&quot; If you do not need to use the Test Regular Expression dialog then type your regexp into the text box provided, click <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold; color: #010100;\">Add<\/span><span class=\"f_ControlIndent\">, and then go to step 8.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">6.<\/span><span class=\"f_ControlIndent\">Type your regular expression into the &quot;Search expression&quot; text box. To simplify the process we have provided a shortcut menu that can be used to easily insert the desired metacharacters into your regexp. Click the &quot;&gt;&quot; button to access this menu. When you choose an option from this menu its corresponding metacharacter will be inserted into the expression and the text insertion point will be moved to the appropriate place required by the character.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">7.<\/span><span class=\"f_ControlIndent\">Type any text that you wish to use to test your expression in the text area provided, and click <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold; color: #010100;\">Test<\/span><span class=\"f_ControlIndent\">. When you are finished testing your expression, click <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold; color: #010100;\">OK<\/span><span class=\"f_ControlIndent\">.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">8.<\/span><span class=\"f_ControlIndent\">Click <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold; color: #010100;\">OK<\/span><span class=\"f_ControlIndent\">.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.5000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">9.<\/span><span class=\"f_ControlIndent\">Continue creating your rule normally.<\/span><\/p>\n\r<p class=\"p_DialogSectionHeading\" style=\"page-break-after: avoid;\"><span class=\"f_DialogSectionHeading\">Configuring a Regexp in a Rule\'s Action<\/span><\/p>\n\r<p class=\"p_ControlIndent\"><span class=\"f_ControlIndent\">To configure a &quot;Search and Replace Words in…&quot; action to use a regular expression:<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">1.<\/span><span class=\"f_ControlIndent\">On the Create Rule dialog, click the checkbox that corresponds to the &quot;<\/span><span class=\"f_ControlIndent\" style=\"font-style: italic;\">Search and Replace Words in...<\/span><span class=\"f_ControlIndent\">&quot; action that you wish to insert into your rule.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">2.<\/span><span class=\"f_ControlIndent\">In the summary area at the bottom of the Create Rule dialog, click the &quot;<\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold; color: #010100;\">specify information<\/span><span class=\"f_ControlIndent\">&quot; link that corresponds to the action that you selected in step 1. This will open the Search and Replace dialog.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">3.<\/span><span class=\"f_ControlIndent\">If you chose the &quot;<\/span><span class=\"f_ControlIndent\" style=\"font-style: italic;\">Search...header<\/span><span class=\"f_ControlIndent\">&quot; action in step 1, then use the drop-down list box provided to choose the header that you wish to search, or type a header into the box if the desired header isn\'t listed. If you did not choose the &quot;<\/span><span class=\"f_ControlIndent\" style=\"font-style: italic;\">Search...header<\/span><span class=\"f_ControlIndent\">&quot; action in step 1 then skip this step.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">4.<\/span><span class=\"f_ControlIndent\">Type the <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic; color: #010100;\">search<\/span><span class=\"f_ControlIndent\"> expression that you wish to use in this action. To simplify the process we have provided a shortcut menu that can be used to easily insert the desired metacharacters into your regexp. Click the &quot;&gt;&quot; button to access this menu. When you choose an option from this menu its corresponding metacharacter will be inserted into the expression and the text insertion point will be moved to the appropriate place required by the character.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">5.<\/span><span class=\"f_ControlIndent\">Type the <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic; color: #010100;\">replace<\/span><span class=\"f_ControlIndent\"> expression that you wish to use in this action. As with the <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-style: italic; color: #010100;\">search<\/span><span class=\"f_ControlIndent\"> expression we have provided a metacharacter shortcut menu for this option as well. Leave this text box blank if you wish to delete a matched sub-string instead of replace it with more text.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">6.<\/span><span class=\"f_ControlIndent\">Click &quot;<\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold; color: #010100;\">Match case<\/span><span class=\"f_ControlIndent\">&quot; if you want the expression to be case sensitive.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">7.<\/span><span class=\"f_ControlIndent\">Click Regular expression if you want the search and replace strings to be treated as regular expressions. Otherwise each will be treated as a simple sub-string search and replace—it will look for an exact literal match of the text rather than process it as a regular expression.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">8.<\/span><span class=\"f_ControlIndent\">If you do not need to test your expression then skip this step. If you do need to test your expression then click &quot;<\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold; color: #010100;\">Run Test<\/span><span class=\"f_ControlIndent\">.&quot; On the Search and Replace Tester dialog, type your search and replace expressions and the text that you wish to test with, then click <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold; color: #010100;\">Test<\/span><span class=\"f_ControlIndent\">. When you are finished testing your regexps click <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold; color: #010100;\">OK<\/span><span class=\"f_ControlIndent\">.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">9.<\/span><span class=\"f_ControlIndent\">Click <\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-weight: bold; color: #010100;\">OK<\/span><span class=\"f_ControlIndent\">.<\/span><\/p>\n\r<p style=\"text-indent: 0; padding-left: 1.4375rem; margin: 0 0 1.0000rem 1.5625rem;\"><span class=\"f_ControlIndent\" style=\"display:inline-block;width:1.4375rem;margin-left:-1.4375rem\">10.<\/span><span class=\"f_ControlIndent\">Continue creating your rule normally.<\/span><\/p>\n\r<p class=\"p_ControlHeading\" style=\"page-break-after: avoid;\"><\/p>\n\r"
})
