Contact Free trial Login


match(String, Regex): Array<String>

Uses an regular expression to match string and then separate it into capture groups. Returns the results in a a list (an array).

It can be applied to the result of any evaluated expression and can return any evaluated expression. See Pattern Matching in DataWeave.


Name Description


A string (String type).


A regular expression for matching characters in the text.


In this example, the regular expression describes an email address. It contains two capture groups: what come before and after the @. The result is an array of three elements: the first is the whole email address, the second matches one of the capture groups, the third matches the other one.


%dw 2.0
output application/json
{ "hello" : "" match(/([a-z]*)@([a-z]*).com/) }


  "hello": [

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.