Nav

matches

matches(String, Regex): Boolean

Matches a string against a regular expression and returns true or false.

Transform

        
     
1
2
3
4
%dw 2.0
output application/json
---
b: "admin123" matches /(\d+)/
Output

        
     
1
2
3
{
  "b": false
}

For use cases where you need to output or conditionally process the matched value, see Pattern Matching in DataWeave.