This function returns a text list with all substrings matching a given regular expression.
findPattern(text, regularExpression) #Output: Text list
Examples
|
Parser expression |
Description |
|---|---|
|
Bash
|
This example returns the following text list: ["1900", "2000", "1.5", "6.1"] |
|
Bash
|
Assuming
this example returns the following text list: ["User1", "User2", "User3", "User4"] |
|
Extract all email addresses from a text field Bash
|
Assuming
this example returns the following text list: ["admin@example.com", "administrator@example.com", "jwt@example.com"] |
|
Processing an Elements Connect (formerly nFeed)* custom field Bash
|
Assuming
this example returns the following text list: ["KEY-1", "KEY-2", "KEY-3"] |
|
Extract all user mentions from the last comment Bash
|
Assuming
this example returns the following text list: ["demo", "user"] |
|
Extract all issue keys from the last comment Bash
|
Assuming
this example returns the following text list: ["DEMO-1", "DEMO-2"] |
|
Extract all URLs from a text field Bash
|
Assuming
this example returns the following text list: ["https://decadis-apps.atlassian.net/wiki/spaces/JWTSDC", "https://decadis-apps.atlassian.net/wiki/spaces/JWTSDC/pages/3323374999/Get+started", "http://www.google.com "] |
Additional information
Parameters used in this function:
|
Parameter |
Input (data type) |
Description |
|---|---|---|
|
|
text |
Any given text. |
|
|
text |
A valid regular expression that grabs all substrings to be returned. |
Output
This function returns a text list
If you want to ignore the case, have a look at the findPatternIgnoreCase() function.
|
Parser expression |
Output |
|---|---|
|
Bash
|
["Green", "Blue"] |
|
Bash
|
[ ] |