Versions Compared

Key

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


UI Text Box
sizemedium
typeinfo

Replaces specific substrings matching a regular expression with a given replacement.

Use this function instead of replaceAll() or replaceFirst() if you want to have full control over the exact substrings you want to replace.


Code Block
languagebash
titleSyntax
linenumberstrue
findModify(text, regex, replacement) #Output: Text


UI Expand
titleExamples


UI Text Box
typeinfo

^% represents each of the matching substrings, and ^ represents the order of appearance beginning with 1.


Parser expressionDescription


Code Block
languagebash
linenumberstrue
findModify("JWT is the best tool!", "JWT", "Jira Workflow Toolbox") 


This example returns 

Jira Workflow Toolbox is the best tool!


Code Block
languagebash
linenumberstrue
findModify("The cure for boredom is curiosity", "[aeiou]", modulus(^, 2) = 1 ? toUpperCase(^%) : ^%) 


This example returns

ThE curE for bOredOm is cUriOsity.


UI Text Box
typeinfo

This example checks for vowels in the given text and writes them into a list.

The output will be e, u, e, o, o, e, o, i, u, i, o, i

For each appearance it checks whether the position is an odd number (modulus).

If the position is an odd number the character will be converted to upper case using the toUpperCase() function.

e - modulus(1,2) = 1 -> E will be upper case
u - modulus(2,2) = 0 -> U will be lower case
e - modulus(3,2) = 1 -> E will be upper case

...

Long story short: Every second vowel will be converted to upper case!




UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
text

Status
subtletrue
titletext

Any given text.
regex

Status
subtletrue
titletext

A valid regular expression that grabs all substrings to be replaced.
replacement

Status
subtletrue
titletext

Any given text.



UI Expand
titleOutput

This function returns a

Status
subtletrue
titleText



Image AddedUse cases and examples

Page properties report
firstcolumnUse case
headingsJWT feature, Workflow function, Field type, Automated action, Parser functions
cqllabel = "parser_func_findmodify" and space = currentSpace()


Page properties
hiddentrue



Status
Tech review

Status
colourGreen
titledone

Style guide

Status
colourGreen
titledone

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged



Page properties
hiddentrue


Short description

Replaces specific substrings matching a given regular expression.

Output

Status
subtletrue
titletext

Available since

Status
subtletrue
colourBlue
title2.2.12

Label