Versions Compared

Key

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

Looking for the documentation on the newest versions of SIL Engine and the Simple Issue Language for Jira 8 for Server/Data Center? Click here !

Info
titleAvailability

This routine is available since katl-commons starting with SIL Engine™ 2.0.3 (for JIRA Jira 5.x ) or katl-commons SIL Engine™ 1.1.10 ( for JIRA Jira 4.3.x and /4.4.x).

Syntax

...

matches(string, regex)

Description

...

Excerpt

Returns "true" if character expression string matches the regular expression regex.

Parameters

...

Parameter name

Type

Required

Description

string

string

Yes

Specifies a character expression to match the regex against.

regex

string

Yes

Specifies a regular expression to match the specified string.

Return type

...

boolean (true/false)

Related routines

Filter by label (Content by label)
showLabelsfalse
spacesSIL40
showSpacefalse
cqllabel = "regex" and space = "SIL"
labelsregex


Example

...

Example 1

...

Code Block
wret = matches("This will return ?", ".*will.*");
print("Return " + wret);

Matches any string containing "will". Prints Return true

Example 2

...

Code Block
wret = matches("This will return ?", "will");
print("Return " + wret);

Matches only the string "will". Prints Return false

Example 3

...

Code Block
wret = matches("This will return ?", ".*will[^\\?]*\\?");
print("Return " + wret);

Matches any string containing "will" and ending with a question mark. Prints Return true

Notes

...

Note
  • As shown in Example 3, use double backslash (\\) instead of a single backslash where needed.
  • For more information on regular expressions, see
http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html

See also

...

Filter by label (Content by label)
showLabelsfalse
max100
showSpacefalse
cqllabel = "string_routines"
labelsstring_routines