String utility regex
When you are creating a workflow with the BMC Atrium Orchestrator Development Studio application, you can use the regex utility to check for patterns in strings or perform substitution on strings. The Regex utility is based on Java’s Regex utility.
The regex utility evaluates or modifies a simple string using the Regex Transform Editor. If you select evaluate, the String utility evaluates the input string and indicates whether the search pattern is contained in the string. The output value of the evaluation is either true or false. If you select modify, the String utility searches the input string for the search text and substitutes that text with the replacement text.
You can use the String utility to evaluate strings with regular expressions, or to substitute a string with a regular expression.
Comments
In general, the Regex syntax appears to follow Java regular expression syntax.
Be careful with input documents that might contain newlines; the Search matches single lines only. Multiline inputs return false even if the pattern matches the first line.
Work around:
prefix the single-line flag
(?s)
to the regex so the dot operator will match newlines.Example:
Given Multiline Input:
The fun guy is Jack
The clever guy is Jim
This Regex returns "false":
.*Jim.*
This Regex returns "true":
(?s).*Jim.*
Thank you for your comment. I am following up with the team and will update the page based on their feedback.
After a discussion with team members, I've updated the page to state that the Regex utility is based on Java’s Regex utility. Thanks again.
Could you please include a link to a reference standard that explains the syntax for this version of Regex?
You see, typically Java uses the syntax, "\1" as back-reference notation for a group match, but this Regex utility uses "$1" for back-reference. Is it possible that this regex follows XPATH Regex instead of Java Regex? There is some overlap between the two, so it would be helpful to eliminate the confusion by identifying a good reference.
Hi Jim,
That is a good question. I've run your comments by a team member and he is going to research this issue. I created DRAUM-21788 to track the issue. As soon as I have more information, I will update the page.
Log in or register to comment.