Data weave more operations
Matches
• (':string', ':regex') ⇒ ':boolean'
• Matches a string against a regular expression,
and returns true or false.
• %dw 1.0
• %output application/json
• ---
• b: "admin123" matches /(d+)/
Transform and output
• { "b": false }
Starts With
Returns true or false depending on if a string starts
with a provided substring.
• %dw 1.0
• %output application/json
• ---
• {
• a: "Mariano" startsWith "Mar",
• b: "Mariano" startsWith "Em"
• }
Transform and output
Ends With
• Returns true or false depending on if a string
ends with a provided substring.
• %dw 1.0
• %output application/json
• ---
• {
• a: "Mariano" endsWith "no",
• b: "Mariano" endsWith "to"
• }
Transform and output
Find
• Given a string, it returns the index position
within the string at which a match was
matched. If found in multiple parts of the
string, it returns an array with the various idex
positions at which it was found. You can either
look for a simple string or a regular
expression.
Transform and output
Match
• Match a string against a regular expression.
Match returns an array that contains the
entire matching expression, followed by all of
the capture groups that match the provided
regex.
Transform and output
Similar
• Evaluates if two values are similar, regardless
of their type. For example, the string "1234"
and the number 1234 aren’t equal, but they
are recognized as similar.
Transform and output

Data weave more operations

  • 1.
    Data weave moreoperations
  • 2.
    Matches • (':string', ':regex')⇒ ':boolean' • Matches a string against a regular expression, and returns true or false. • %dw 1.0 • %output application/json • --- • b: "admin123" matches /(d+)/
  • 3.
  • 4.
    Starts With Returns trueor false depending on if a string starts with a provided substring. • %dw 1.0 • %output application/json • --- • { • a: "Mariano" startsWith "Mar", • b: "Mariano" startsWith "Em" • }
  • 5.
  • 6.
    Ends With • Returnstrue or false depending on if a string ends with a provided substring. • %dw 1.0 • %output application/json • --- • { • a: "Mariano" endsWith "no", • b: "Mariano" endsWith "to" • }
  • 7.
  • 8.
    Find • Given astring, it returns the index position within the string at which a match was matched. If found in multiple parts of the string, it returns an array with the various idex positions at which it was found. You can either look for a simple string or a regular expression.
  • 9.
  • 10.
    Match • Match astring against a regular expression. Match returns an array that contains the entire matching expression, followed by all of the capture groups that match the provided regex.
  • 11.
  • 12.
    Similar • Evaluates iftwo values are similar, regardless of their type. For example, the string "1234" and the number 1234 aren’t equal, but they are recognized as similar.
  • 13.