Contact Free trial Login


scan(String, Regex): Array<Array<String>>

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).


Name Description


The text to scan (String type).


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" : "," scan /([a-z]*)@([a-z]*).com/


  "hello": [

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub