GetMatchRegEx
Last updated
Was this helpful?
Last updated
Was this helpful?
Name
GetMatchRegEx
Syntax
GetMatchRegEx (String pattern, String str)
Purpose
To return a result if a match was found. Otherwise, returns an empty string.
Description
Scans the string for an occurrence of text matching the specified regular expression.
Return Type
String
Parameters
pattern [System.String] – Regular expression pattern to match
str [System.String] – String to search for a match
Example
In this example, we will pass the required parameters to the function transformation object using a Variables object.
Where,
Pattern = ^H[\S]{0,4}|$
String = HelloWorld!
In the output window, you can see that Astera has returned a string value, as the regular expression pattern has been matched.