Overview
A number of apps provide advanced features that require the use of regular expressions for pattern matching. Generally, just a simple understanding of regular expressions and a few examples are enough to get by for most use cases. This page has a few simple examples to get started. Use the references for more advanced information. It is recommended to test your regular expressions in one of the well-known regex testing sites such as RegexPlanet or Regex101.
|
---|
Info | |
---|---|
title | Regex for workflow conditions For Jira workflow functions using regex expressions to condition whether the post function should continue processing, a blank pattern means that condition processing is not done and processing should continue. |
Tip | |
---|---|
title | Key tips
|
Simple examples
...
autoNumber | true |
---|
Value | Regex | Matches | Demonstrates |
---|---|---|---|
|
| . matches any single character | |
|
|
...
| |||
|
| ||
|
| Escape special regex characters with backslash if necessary | |
|
| Regex is NOT generic matching | |
|
| + indicates 1 or more | |
|
| ||
|
| ||
|
| ||
|
| [ ] indicates a class of characters | |
|
| ||
|
|
...
| |||
|
| ^ in a class means NOT the following character | |
|
| | indicates OR | |
|
| ||
|
| ||
|
| defaults to case sensitive matching | |
|
| (?i) indicates case insensitive matching | |
|
| () indicates a grouping | |
|
| ||
|
| \d for digits | |
|
| \s for whitespace | |
|
| \S for non whitespace | |
| Value must have at least 1 non whitespace character | ||
|
| ||
|
| Word boundaries. Finding words in a comma or blank separated list using word boundaries | |
|
| ||
|
| Looking for text matches in a comma separated list by covering all cases: only, start, middle, and end. This uses the multi-line flag: (?m) | |
|
| ||
|
|
Advanced examples
Value | Regex | Matches | Find | Demonstrates |
---|---|---|---|---|
|
| Find string not containing a word. In this example, files that do not have a .png extension | ||
|
| Find string not containing a word. In this example, files that do not have a .png extension | ||
|
| Find string not containing a word. In this example, files that do not have a .png or .jpeg extension | ||
|
| Match exact words anywhere in string. In this case, a blank separated list of labels and both collateral and retail must be included for the match to be successful | ||
|
| Both are required for a match | ||
|
| Match string containing either word |
Filter by label (Content by label) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
References
RegexOne - interactive tutorials to learn how to construct regular expressions
Regexlib.com - searchable collection of user-contributed regular expressions
RegexPlanet test site - test your expressions quickly
Regex101 test site - understand a regex expression and test it
Quick reference - best once you have the concepts