

Table 25.2 shows the string comparison operators and their behaviors. Returns -1 if less than, 0 if equal, and 1 if greater than TABLE 25.1 Numeric Comparison Operators in Perl Operator Table 25.1 shows the numeric comparison operators and their behavior. Perl has comparison opera tors for numbers and strings. Most frequently, a comparison operator is used within an if statement or loop. Swaps basic_regex or match_results objects.Ĭomparison of various objects, not equal.Ĭomparison of various objects, greater than.Ĭomparison of various objects, greater than or equal.The comparison operators used by Perl are similar to those used by C, awk, and the csh shells, and are used to specify and compare values (including strings). Type definition for wstring regex_token_iterator. Type definition for wstring regex_iterator. Type definition for wstring match_results. Type definition for wchar_t regex_token_iterator. Type definition for wchar_t regex_iterator. Type definition for wchar_t match_results. Type definition for string regex_token_iterator. Type definition for string regex_iterator. Type definition for string match_results.

Type definition for char regex_token_iterator. Classes Classĭescribes characteristics of elements for matching.ĭescribes characteristics of char for matching.ĭescribes characteristics of wchar_t for matching. Example to create logical 'or' or '' operations in regular expressions - a simple tutorial as part of the OCPsoft regular expressions guide. To modify the details of the grammar of regular expressions, write a class that implements the regular expression traits. To iterate through multiple matches of a regular expression object, use the class templates regex_iterator Class and regex_token_iterator Class or one of their specializations, cregex_iterator, sregex_iterator, wcregex_iterator, wsregex_iterator, cregex_token_iterator, sregex_token_iterator, wcregex_token_iterator, or wsregex_token_iterator, together with the match flags of type regex_constants::match_flag_type. To replace text that matches a regular expression object, use the template function regex_replace, together with the match flags of type regex_constants::match_flag_type. These functions return results by using the class template match_results Class and its specializations, cmatch, wcmatch, smatch, and wsmatch, together with the class template sub_match Class and its specializations, csub_match, wcsub_match, ssub_match, and wssub_match. To search text for matches to a regular expression object, use the template functions regex_match and regex_search, together with the match flags of type regex_constants::match_flag_type. To create a regular expression object, use the class template basic_regex Class or one of its specializations, regex and wregex, together with the syntax flags of type regex_constants::syntax_option_type. Defines a class template to parse Regular Expressions (C++), and several class templates and functions to search text for matches to a regular expression object.
