ClassesClassesClassesClasses | | | | Operators

tuple_regexp_testtuple_regexp_testTupleRegexpTesttuple_regexp_testTupleRegexpTestTupleRegexpTest (Operator)

Name

tuple_regexp_testtuple_regexp_testTupleRegexpTesttuple_regexp_testTupleRegexpTestTupleRegexpTest — Test if a string matches a regular expression.

Signature

tuple_regexp_test( : : Data, Expression : NumMatches)

Herror tuple_regexp_test(const char* Data, const char* Expression, Hlong* NumMatches)

Herror T_tuple_regexp_test(const Htuple Data, const Htuple Expression, Htuple* NumMatches)

Herror tuple_regexp_test(const HTuple& Data, const HTuple& Expression, Hlong* NumMatches)

void TupleRegexpTest(const HTuple& Data, const HTuple& Expression, HTuple* NumMatches)

HTuple HTuple::TupleRegexpTest(const HTuple& Expression) const

void HOperatorSetX.TupleRegexpTest(
[in] VARIANT Data, [in] VARIANT Expression, [out] VARIANT* NumMatches)

VARIANT HTupleX.TupleRegexpTest(
[in] VARIANT Data, [in] VARIANT Expression)

static void HOperatorSet.TupleRegexpTest(HTuple data, HTuple expression, out HTuple numMatches)

HTuple HTuple.TupleRegexpTest(HTuple expression)

Description

tuple_regexp_testtuple_regexp_testTupleRegexpTesttuple_regexp_testTupleRegexpTestTupleRegexpTest applies the regular expression in ExpressionExpressionExpressionExpressionExpressionexpression to one or more input strings in DataDataDataDataDatadata, and returns the number of matching strings in NumMatchesNumMatchesNumMatchesNumMatchesNumMatchesnumMatches. 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_matchtuple_regexp_matchTupleRegexpMatchtuple_regexp_matchTupleRegexpMatchTupleRegexpMatch for syntax and options of regular expressions. Additionally, tuple_regexp_testtuple_regexp_testTupleRegexpTesttuple_regexp_testTupleRegexpTestTupleRegexpTest supports the option 'invert_match'"invert_match""invert_match""invert_match""invert_match""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.

Exception: Empty input tuple

If the input tuple is empty, the operator returns 0.

HDevelop In-line Operation

HDevelop provides an in-line operation for tuple_regexp_testtuple_regexp_testTupleRegexpTesttuple_regexp_testTupleRegexpTestTupleRegexpTest, which can be used in an expression in the following syntax:

NumMatches := regexp_test(Data, Expression) or NumMatches := Data =~ Expression

Parallelization

Parameters

DataDataDataDataDatadata (input_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Input strings to match.

ExpressionExpressionExpressionExpressionExpressionexpression (input_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Regular expression.

Default value: '.*' ".*" ".*" ".*" ".*" ".*"

Suggested values: '.*'".*"".*"".*"".*"".*", 'invert_match'"invert_match""invert_match""invert_match""invert_match""invert_match", 'ignore_case'"ignore_case""ignore_case""ignore_case""ignore_case""ignore_case", 'multiline'"multiline""multiline""multiline""multiline""multiline", 'dot_matches_all'"dot_matches_all""dot_matches_all""dot_matches_all""dot_matches_all""dot_matches_all", 'newline_lf'"newline_lf""newline_lf""newline_lf""newline_lf""newline_lf", 'newline_crlf'"newline_crlf""newline_crlf""newline_crlf""newline_crlf""newline_crlf", 'newline_cr'"newline_cr""newline_cr""newline_cr""newline_cr""newline_cr"

NumMatchesNumMatchesNumMatchesNumMatchesNumMatchesnumMatches (output_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Number of matching strings

Example (HDevelop)

tuple_regexp_test ('p10662599755', '[A-Z]*', Result)
* Returns 0

tuple_regexp_test ('p10662599755', ['[A-Z]*','ignore_case'], Result)
* Returns 1

Alternatives

tuple_strstrtuple_strstrTupleStrstrtuple_strstrTupleStrstrTupleStrstr

See also

tuple_regexp_matchtuple_regexp_matchTupleRegexpMatchtuple_regexp_matchTupleRegexpMatchTupleRegexpMatch, tuple_regexp_replacetuple_regexp_replaceTupleRegexpReplacetuple_regexp_replaceTupleRegexpReplaceTupleRegexpReplace, tuple_regexp_selecttuple_regexp_selectTupleRegexpSelecttuple_regexp_selectTupleRegexpSelectTupleRegexpSelect

Module

Foundation


ClassesClassesClassesClasses | | | | Operators