Skip to main content Skip to complementary content

matches

Returns true if a regular expression matches an input string.

Information noteNote: The last two arguments are only supported in Talend Cloud Pipeline Designer and Talend Data Mapper.
Unlike the find function, the matches function only returns true when the regular expression matches the entire input.

Arguments

  1. Input string.
  2. Regular expression as a string.
  3. Optional: Boolean defining whether the regular expression is case insensitive. The default value is false.
  4. Optional: Boolean defining whether the . character matches any character, including line terminators. The default value is true.
  5. Optional: Timeout in milliseconds as a long. The default value is 10000.
  6. Optional: Boolean defining whether white space characters should be ignored in the expression. The default value is false.
  7. Optional: Boolean defining whether the input should be processed as multiple lines instead of a single string. If it is enabled, the ^ character can be used to match the beginning of the input and the beginning of each line, and the $ character can be used to match the end of the input and the end of each line. The default value is false.

Examples

Expression Result
matches("Hello World!", "\w+ \s\w+!", true, true, 15000, true, false) true

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!