View Single Post
T1MOXA
Member
Join Date: Aug 2016
Old 07-18-2018 , 16:47   Re: Can't compile regex expression.
Reply With Quote #3

Quote:
Originally Posted by Dr!fter View Post
How about you, idk, use the error params...

PHP Code:
Regex CompileRegex(const char[] patternint flagschar[] errorint maxLenRegexErrorerrcode
Ill just add, that you should use SM 1.9 for those (since they were broken previously)
Thanks...

PHP Code:
#include <regex>

public void OnPluginStart() {
    
char sError[128];
    
RegexError rError;
    
Handle hExpression CompileRegex("[\\x{D800}-\\x{DBFF}]"PCRE_UCPsErrorsizeof(sError), rError);
    
PrintToServer("Regex: %i | Error: %s | RegexError: %i"hExpressionsErrorrError);

Regex: 0 | Error: this version of PCRE is not compiled with Unicode property support | RegexError: 16

sm exts list
Regex (1.9.0.6241): Provides regex natives for plugins

With PCRE_CASELESS flag:
Regex: 0 | Error: character value in \x{...} sequence is too large | RegexError: 3

Last edited by T1MOXA; 07-18-2018 at 16:54.
T1MOXA is offline