matches()

This function returns true, if the given text matches a regular expression, otherwise it returns false.


Bash
matches(text, regularExpression) #Output: Boolean


Examples

Parser expression

Description

Bash
 matches("readme.txt", ".*\\.txt$")

This example returns a boolean value:

true

Bash
matches("Jira Workflow Toolbox", "[JWT].+")

This example returns a boolean value:

true

Bash
matches("Admin Toolbox", "[JWT].+")

This example returns a boolean value:

false

Bash
matches(%{issue.attachment.details}, "(.*text/plain.*){1,}")


This example returns

true

if the current issue has at least one .txt file attached. This is a perfect example for a Logical validator.

The field used in this expression is: Attachments with details

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

text

text

Any given text.

regularExpression

text

A valid

regular expression

that the given text will be checked against.

Output

This function returns a boolean  


📚 Use cases and examples