SimpleRegexMatch

Last Updated2008-03-26
Created At2008-03-26

Matches a string against a regular expression pattern.

Notes

If you intend on using the same regular expression pattern multiple times, consider using CompileRegex and MatchRegex instead of making this function reparse the expression each time.

stock int SimpleRegexMatch(const char[] str, const char[] pattern, int flags = 0, char[] error = "", int maxLen = 0)

Parameters

const char[] str
The string to check.
const char[] pattern
The regular expression pattern.
int flags
General flags for the regular expression.
char[] error
Error message, if applicable.
int maxLen
Maximum length of the error buffer.

Return Value

int Number of substrings found or -1 on failure.