Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This guide cover how to create simple pattern matches and how to use special characters within Regex.

...

Regex uses special characters to perform certain functions. Some Special characters that will help with creating expressions are:

Special character

Function

.

This will match any single character other than a newline

*

This matches zero or more consecutive characters. For example (/ba*) will match “ba” and “baaa” as the expression will match more than one “a” characters.

\

Escape following special character. This will allow special characters to be matched within the email. For example if you are looking for “[abc]” the regex will have to be \[abc\] as this will mean that the regex will also look for “[ ]” as a character.

( )

Used to define a capture group within a regex.

[ ]

This is used to define which Character sets you want to capture. For example ([a-z]) will capture all characters that are a lower case alphabetical character.

{ }

Indicates how many characters the value must have. This can be an exact number or between a certain range.

+

Matches one or more consecutive characters.

|

Matches either what is before or after the | allowing for a or condition

In regards to the expression .*

The expression is a wildcard it’s usage should be restricted and only when completely necessary. This expression will match everything. If used incorrectly this can cause long processing times due to the expression evaluating a possibly long input which significantly delays processing in JEMH Data Center/JEMH Cloud.