CAPL Script

StrstrRegex

Syntax

long strstr_regex(char s[], char pattern[])

long strstr_regex_off(char s[], long offset, char pattern[])

Function

Searches for a regular expression pattern in a string.

Parameters

s String to be searched.

offset

Offset in s at which the search shall be started.

pattern

Regular expression which is searched. For the regular expression, the same syntax is used as in the Perl programming language.

Return Values

The position in s where the pattern was found, or -1 if it wasn’t found.

char buffer[70] = "Vector Informatik";long res;res = strstr_regex(buffer, "Inf[a-z]*"); // 7res = strstr_regex_off(buffer, res + 1, "Inf[a-z]*"); // -1

str_match_regex | str_replace | str_replace_regex | String Literal