Returns a list (array) with all of the matches found within the given string.
Each match is returned as an array that contains the complete match followed by any capture groups in your regular expression (if present).
The text to scan (
A regular expression that describes the pattern to look for in the text.
In the example, the
regex describes an email address. It contains two
capture groups, the characters before and after the
@. It produces an
an array matching the two email addresses in the input string. Each match
is an array of three elements: The first is the entire email address, and the
second and third are matches to the
regex capture groups.
%dw 2.0 output application/json --- "hello" : "email@example.com,firstname.lastname@example.org" scan /([a-z]*)@([a-z]*).com/