Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device.
Atlassian cookies and tracking notice, (opens new window)
Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
🔍 Discover Our Product Documentation

Reference
Results will update as you type.
  • What's New in Barracuda Campus
  • New Google/Yahoo Bulk Sender Requirements
  • Release Notes by Product
  • Barracuda Networks Appliance Quick Start Guides
  • Using Barracuda Campus
  • Contacting Barracuda Networks Technical Support
  • License Definitions - Email Protection Products
  • Serial Number for Hardware and Virtual Appliances
  • License or Trial Expiration for Barracuda Networks Email Protection
  • Activate and Update Barracuda Networks Products
  • Recommended Configuration Settings for Barracuda Networks Cloud Products
  • Using Third-Party Security Awareness Training with Barracuda Products
  • Hardware Support
  • Security for Integrating with Other Systems - Best Practices
  • Enhancements to Barracuda Advanced Threat Protection
  • Understanding Advanced Threat Protection Reports
  • Virtual Deployment Management
  • Cloud Deployment Management
  • Barracuda Central Operations Center
  • Barracuda Networks Reference MIB
  • Regular Expressions
  • Barracuda DC Agent for User Authentication
  • Barracuda Terminal Server Agent
  • How to Create Certificates with XCA
  • Web Security Solutions
  • Security Updates Available for Certain Barracuda Products

    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    Regular Expressions
    Published Mar 13

    Regular Expressions

    Mar 13, 2026
    Subscribe

    A regular expression is a combination of characters or character classes and operators that describe text for matching purposes. Regular expressions are like wildcards, only more powerful. With Email Gateway Defense or the Barracuda Email Security Gateway, for example, you can use regular expressions in many of its block/allow features.

    Note: Matches are not case-sensitive. All regular expressions are lowercase before use as is the text against which expressions are matched. For this reason, you cannot use capital letter character classes.

    Be careful when using special characters including |, *, '.' which are not taken literally unless escaped with a preceding backslash '\' character.

    Operators

    Operators recognized in regular expressions include:

    *

    zero or more times

    +

    one or more times

    ?

    zero or one time

    |

    or

    ( )

    grouping

    Character Classes

    A character class matches a character or range of characters listed between brackets '[' and ']'. Use a dash '-' to specify a range of characters. Use the '^' character inside the brackets '[' and ']' to negate a class. Some examples are:

    .

    any character except newline

    [ac]

    one of the following characters:  a A c C

    [^ac]

    anything but the characters 'a', 'A', 'c', 'C'

    [a-z]

    letters 'a' through 'z' regardless of case

    [a-z.]

    letters 'a' through 'z' or 'A' through 'Z' or a dot

    [a-z\-]

    any alphabetic character or a dash

    \d

    digit, shortcut for [0-9]

    [^\d]

    non-digit

    \w

    part of word: shortcut for [A-Za-z0-9_]

    [^\w]

    non-word character

    \s

    space character: shortcut for [ \n\r\t]

    [^\s]

    non-space character

    Miscellaneous Characters

    ^

    beginning of line

    $

    end of line

    \b

     

    word boundary

    \t

    tab character

    Special Characters

    The following characters have a special meaning in regular expressions on Barracuda Email Gateway Defense and are prepended by a backslash '\' character when they are interpreted literally:

    .

    [

    ]

    \

    *

    ?

    $

    (

    )

    |

    ^

    @

    /

    Examples

    \bcialis\b

    matches cialis, but not specialist

    p[^\w]?h[^\w]?a[^\w]?r[^\w]?m[^\w]?a[^\w]?c[^\w]?y

    matches pha,rmacy or P.harm-acy

    viagra

    matches viagra, VIAGRA or vIaGRa

    \d+

    matches 1 or more digits: 0, 42, 007

    (bad|good)

    matches the letters 'bad' or matches the letters 'good'

    ^free

    matches the letters 'free' at the beginning of a line

    v[i1]agra

    matches viagra or v1agra

    v(ia|1a)gra

    matches viagRA or v1agra

    v\|agra

    matches v|Agra, V|Agra, v|agRa, etc.

    v(i|1|\|)?agra

    matches vagra, viaGra, v1agrA, V|AGRA, etc.

    \*FREE\*

    matches *FREE*, *frEE*, etc.

    \*FREE\* V.*GRA

    matches *FREE* VIAGRA, *Free* VEHiCLegrA, etc.

    http:\/\/

    matches http://

     

     


    We value your feedback.
    If you have questions, suggestions, or feedback on our documentation, contact the Campus Product Documentation team.
    For general product inquiries or technical support, please contact the global Barracuda Support team.

    {"serverDuration": 32, "requestCorrelationId": "4e2c96c0a33040538d3819314b61504c"}