How to use regular expressions.
Regular expressions are formulas that can be used to match or find character strings by employing wildcards and metasigns. In CodeTwo Exchange Rules family the regular expressions may be used for removing a sensitive content or check if the subject contains some regular text. As opposed to searching text phrases, regular expressions make it possible to create a formula that will cover a variety of character strings.
Summing up, string fragment 2-c matches our regular expression [0-9]-[a-z].
This way we specify that the searched string should contain 3 characters that are digits or letters, next one dash and it should be ended by two characters which are digits or letters.
- matches John1, Johns, John@ etc.
- matches A53, S11, _a0, a_0 etc.
- matches no 3, no 8, etc.
- matches John, Johny, Johnny, John12311, John?, John!
- matches 007, 123, 545, etc.
- matches 123, 3245234 etc.
- matches 1, 11, etc.
- matches no, to, oo, on, nn, etc.
- means any character that is NOT a digit and that is not a letter, e.g. @, &, ), #, etc.
\ means that the character that follows should be treated as a normal character, not as a syntax element, e.g. \. Means a dot rather than any character.
- matches only string \small. (with a dot at the end).
\n is a new line.
\r is a carriage return.
If you'd like to learn more about regular expressions, go here.