--- title: "Regular Expressions (regex)" slug: "regular-expressions-regex" tags: ["Security for MS Exchange", "Product Usage"] updated: 2026-09-02T14:48:28Z published: 2026-09-02T14:48:28Z canonical: "docs.trellix.com/regular-expressions-regex" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.trellix.com/llms.txt > Use this file to discover all available pages before exploring further. # Regular Expressions (regex) Here are answers to frequently asked questions on the regular expressions (regex). ### Does enabling regex cause email latency? Yes, enabling regular expression causes email latency, as content scanning is a process intensive configuration. ### Where do I find more information on regex? Several websites on the Internet provide information on regular expressions. For example, see: - [http://www.regular-expressions.info/reference.html](http://www.regular-expressions.info/reference.html) - [http://www.regexbuddy.com/regex.html](http://www.regexbuddy.com/regex.html) ### How do I block credit card and social security numbers using regex? 1. From the product's user interface, click Policy Manager → Shared Resource. The **Shared Resources** page appears. 2. In the **DLP and Compliance Dictionaries** tab, click **New Category** and specify a category name. 3. Click **OK**. 4. Under **DLP and Compliance Rules**, click **Create New**. 5. Specify the **Rule Name**, **Description** and under **Word or Phrase** specify the regular expression. Based on the example mentioned below, you can also create a similar regular expression for Social Security numbers. For more examples on regular expressions, refer http://www.regular-expressions.info/examples.html. Example: How to validate Credit Card Numbers | Card type | Regular Expression | Description | | --- | --- | --- | | Visa | **`^4[0-9]{12}(?:[0-9]{3})?$`** | All Visa card numbers start with number 4. New cards have 16 digits. Old cards have 13. | | MasterCard | **`^5[1-5][0-9]{14}$`** | All MasterCard numbers start with the numbers 51 through 55. All have 16 digits. | | American Express | **`^3[47][0-9]{13}$`** | American Express card numbers start with 34 or 37 and have 15 digits. | | Diners Club | **`^3(?:0[0-5]\|[68][0-9])[0-9]{11}$`** | Diners Club card numbers begin with 300 through 305, 36 or 38. All have 14 digits. There are Diners Club cards that begin with 5 and have 16 digits. These are a joint venture between Diners Club and MasterCard, and should be processed like a MasterCard. | | Discover | **`^6(?:011\|5[0-9]{2})[0-9]{12}$`** | Discover card numbers begin with 6011 or 65. All have 16 digits. | | JCB | **`^(?:2131\|1800\|35\d{3})\d{11}$`** | JCB cards beginning with 2131 or 1800 have 15 digits. JCB cards beginning with 35 have 16 digits. | 6. Select the **Regular Expression** option and click **Save**. 7. Add this to the **DLP and Compliance** policy in **Policy Manager** by clicking Policy Manager → On-Access (Primary policy) → DLP and Compliance. 8. Under **Activation**, select **Enable**. 9. Under **DLP and Compliance rules and associated actions**, click **Add rule**. 10. Under **Select rules group**, select the regex rule that you created earlier from the drop-down list. 11. Specify the action to take, when the rule is triggered. 12. Click **Save**. :