Description
A number of add-ons 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 will just give a few simple examples to get started. Use the references for more advanced information.
Info | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
|
References
- Regex test site - test your expressions quickly
- Wikipedia regular expressions
- Regular expression reference
- Quick reference - best once you have the concepts
- Using word boundaries
Simple examples
Value | Regex | Matches | Demonstrates |
---|---|---|---|
ABC | A.C | . matches any single character | |
ABC | A.* | * indicates 0 or more | |
ABC | .*C | ||
A.B | A\.B | Escape special regex characters with backslash if necessary | |
ABC | AB* | Regex is NOT generic matching | |
ABC | A.+ | + indicates 1 or more | |
ABC | ABC.+ | ||
ABC | ABC.* | ||
ABCD | ABC.* | ||
ABC | [ABCD] | [ ] indicates a class of characters | |
ABC | [ABZ] | ||
ABC8 | [A-Z0-9] | - indicates a range of characters | |
ABC | [AB^C] | ^ in a class means NOT the following character | |
ABC | DEF|ABC | | indicates OR | |
image.png | .*png|.*jpg | ||
image.jpg | .*png|.*jpg | ||
image.JPG | .*png|.*jpg | defaults to case sensitive matching | |
image.JPG | (?i).*png|.*jpg | (?i) indicates case insensitive matching | |
ABAB | (AB)+ | () indicates a grouping | |
ABCD | (AB)+ | ||
112233 | \d+ | \d for digits | |
A B | A\s*B | \s for whitespace | |
ABC | \S* | \S for non whitespace | |
\S+ | Value must have at least 1 non whitespace character | ||
A | \S+ | ||
XYZ,ABC,UVW | .*\bABC\b.* | Finding words in a comma or blank separated list using word boundaries | |
XYZ,ABCD,UVW | .*\bABC\b.* |
...
Div | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
On this page
|
Include Page | ||||
---|---|---|---|---|
|