str_match_regex
Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DEFunction Syntax
Description
Checks whether a string completely matches a regular expression pattern.Parameters
- s: String to be checked.
- pattern: Regular expression against which the string is matched. For the regular expression, the same syntax is used as in the Perl programming language.
Return Values
1 if the string matches the pattern, 0 if it doesn’t match the pattern.Example
Example 1., [, {, }, (, ), \, *, +, ?, |, ^, and $. The symbol ] also needs escaping if it is preceded by a [ symbol. As regular string literals also use backslash for escaping, there need to be two backslashes to escape a symbol inside a regular expression.
Other symbols can obtain special meaning in regular expressions, if they are escaped with backslash. An example for this would be the character class d which can be used to match digits.
Example 2