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
- Input string.
- Regular expression as a string.
- Optional: Boolean defining whether the regular expression is case insensitive. The default value is false.
- Optional: Boolean defining whether the . character matches any character, including line terminators. The default value is true.
- Optional: Timeout in milliseconds as a long. The default value is 10000.
- Optional: Boolean defining whether white space characters should be ignored in the expression. The default value is false.
- 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 |