Operators |
tuple_regexp_test — Test if a string matches a regular expression.
tuple_regexp_test( : : Data, Expression : NumMatches)
tuple_regexp_test applies the regular expression in Expression to one or more input strings in Data, and returns the number of matching strings in NumMatches. In particular, the result for a single input string will be 1 in case of a match, and 0 otherwise.
Please refer to the documentation of tuple_regexp_match for syntax and options of regular expressions. Additionally, tuple_regexp_test supports the option 'invert_match' , which causes those input strings to be counted which do not match the regular expression.
For convenient use in conditional expressions, this functionality is also available as the '=~' operation in HDevelop.
For general information about string operations see Tuple / String Operations.
If the input tuple is empty, the operator returns 0.
HDevelop provides an in-line operation for tuple_regexp_test , which can be used in an expression in the following syntax:
NumMatches := regexp_test(Data, Expression) or NumMatches := Data =~ Expression
Input strings to match.
Regular expression.
Default value: '.*'
Suggested values: '.*' , 'invert_match' , 'ignore_case' , 'multiline' , 'dot_matches_all' , 'newline_lf' , 'newline_crlf' , 'newline_cr'
Number of matching strings
tuple_regexp_test ('p10662599755', '[A-Z]*', Result) * Returns 0 tuple_regexp_test ('p10662599755', ['[A-Z]*','ignore_case'], Result) * Returns 1
tuple_regexp_match, tuple_regexp_replace, tuple_regexp_select
Foundation
Operators |