Merge pull request #156 from 9iky6/patch-11
Fix stock regex_match_simple
This commit is contained in:
commit
666aaf013a
|
@ -305,16 +305,12 @@ native Regex:regex_match_all(const string[], const pattern[], flags = 0, error[]
|
|||
stock regex_match_simple(const str[], const pattern[], flags = 0, error[]= "", maxLen = 0, &errcode = 0)
|
||||
{
|
||||
new Regex:regex = regex_compile_ex(pattern, flags, error, maxLen, errcode);
|
||||
|
||||
if (regex < 0)
|
||||
if (regex < REGEX_OK)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
new substrings = regex_match_c(regex, str);
|
||||
|
||||
new substrings = regex_match_c(str, regex);
|
||||
regex_free(regex);
|
||||
|
||||
return substrings;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user