#include <string.h>\r
#include <ctype.h>\r
#include <setjmp.h>\r
-#include "sqstdstring.h"\r
+#include <sqstdstring.h>\r
\r
#ifdef _UINCODE\r
#define scisprint iswprint\r
}\r
\r
\r
- SQInteger op;\r
SQBool isgreedy = SQFalse;\r
unsigned short p0 = 0, p1 = 0;\r
switch(*exp->_p){\r
}\r
if(isgreedy) {\r
SQInteger nnode = sqstd_rex_newnode(exp,OP_GREEDY);\r
- op = OP_GREEDY;\r
exp->_nodes[nnode].left = ret;\r
exp->_nodes[nnode].right = ((p0)<<16)|p1;\r
ret = nnode;\r
exp->_matches[capture].begin = cur;\r
exp->_currsubexp++;\r
}\r
- \r
+ int tempcap = exp->_currsubexp;\r
do {\r
SQRexNode *subnext = NULL;\r
if(n->next != -1) {\r
}\r
} while((n->next != -1) && (n = &exp->_nodes[n->next]));\r
\r
+ exp->_currsubexp = tempcap;\r
if(capture != -1) \r
exp->_matches[capture].len = cur - exp->_matches[capture].begin;\r
return cur;\r
} \r
case OP_WB:\r
- if(str == exp->_bol && !isspace(*str)\r
+ if((str == exp->_bol && !isspace(*str))\r
|| (str == exp->_eol && !isspace(*(str-1)))\r
|| (!isspace(*str) && isspace(*(str+1)))\r
|| (isspace(*str) && !isspace(*(str+1))) ) {\r
if(str == exp->_eol) return str;\r
return NULL;\r
case OP_DOT:{\r
- *str++;\r
+ str++;\r
}\r
return str;\r
case OP_NCLASS:\r
case OP_CLASS:\r
if(sqstd_rex_matchclass(exp,&exp->_nodes[node->left],*str)?(type == OP_CLASS?SQTrue:SQFalse):(type == OP_NCLASS?SQTrue:SQFalse)) {\r
- *str++;\r
+ str++;\r
return str;\r
}\r
return NULL;\r
case OP_CCLASS:\r
if(sqstd_rex_matchcclass(node->left,*str)) {\r
- *str++;\r
+ str++;\r
return str;\r
}\r
return NULL;\r
default: /* char */\r
if(*str != node->type) return NULL;\r
- *str++;\r
+ str++;\r
return str;\r
}\r
return NULL;\r
break;\r
node = exp->_nodes[node].next;\r
}\r
- *text_begin++;\r
+ text_begin++;\r
} while(cur == NULL && text_begin != text_end);\r
\r
if(cur == NULL)\r