Searches the specified string for a pattern match using an already compiled regular expression.
| Category: | Regular Expression |
| Returned data type: | Boolean |
specifies the string value in which you want to search for the pattern defined by your compiled regular expression. This can be an explicit string ("MyValue"). This can also be a variable already defined in your expression code or passed to the expression node as a column from a previous node (MyValue or "My Value").
| Requirement | input must not be NULL or blank. |
//You must define a regex object
regex r
//Then compile your regular expression. This one will match any single
// uppercase letter
r.compile("[A-Z]")
// If a pattern match is found this will evaluate to 1 (TRUE)
if r.findfirst("Abc")
// Print the output to the statistics file. You must run
// this job for stats to be written. A preview will not generate
// a message in the log.
print("Found match starting at " & r.matchstart() & " length " & r.matchlength())
// Terminate the expression node processing
seteof()