Index: src/test_regexp.c ================================================================== --- src/test_regexp.c +++ src/test_regexp.c @@ -24,11 +24,11 @@ ** X$ X occurring at the end of the string ** . Match any single character ** \c Character c where c is one of \{}()[]|*+?. ** \c C-language escapes for c in afnrtv. ex: \t or \n ** \uXXXX Where XXXX is exactly 4 hex digits, unicode value XXXX -** \xXXX Where XXX is any number of hex digits, unicode value XXX +** \xXX Where XX is exactly 2 hex digits, unicode value XX ** [abc] Any single character from the set abc ** [^abc] Any single character not in the set abc ** [a-z] Any single character in the range a-z ** [^a-z] Any single character not in the range a-z ** \b Word boundary @@ -385,27 +385,27 @@ static const char zTrans[] = "\a\f\n\r\t\v"; int i, v = 0; char c; if( p->sIn.i>=p->sIn.mx ) return 0; c = p->sIn.z[p->sIn.i]; - if( c=='u' && p->sIn.i+5sIn.mx ){ + if( c=='u' && p->sIn.i+4sIn.mx ){ const unsigned char *zIn = p->sIn.z + p->sIn.i; - v = 0; if( re_hex(zIn[1],&v) && re_hex(zIn[2],&v) && re_hex(zIn[3],&v) && re_hex(zIn[4],&v) ){ p->sIn.i += 5; return v; } } - if( c=='x' ){ - v = 0; - for(i=1; p->sIn.isIn.mx && re_hex(p->sIn.z[p->sIn.i+i], &v); i++){} - if( i>1 ){ - p->sIn.i += i; + if( c=='x' && p->sIn.i+2sIn.mx ){ + const unsigned char *zIn = p->sIn.z + p->sIn.i; + if( re_hex(zIn[1],&v) + && re_hex(zIn[2],&v) + ){ + p->sIn.i += 3; return v; } } for(i=0; zEsc[i] && zEsc[i]!=c; i++){} if( zEsc[i] ){ Index: test/regexp1.test ================================================================== --- test/regexp1.test +++ test/regexp1.test @@ -195,16 +195,16 @@ } {1 1 1 1 1 1 1 1 1 1 1 1} do_execsql_test regexp1-2.20 { SELECT 'abc$¢€xyz' REGEXP '^abc\u0024\u00a2\u20acxyz$', 'abc$¢€xyz' REGEXP '^abc\u0024\u00A2\u20ACxyz$', - 'abc$¢€xyz' REGEXP '^abc\x24\xa2\x20acxyz$' + 'abc$¢€xyz' REGEXP '^abc\x24\xa2\u20acxyz$' } {1 1 1} do_execsql_test regexp1-2.21 { SELECT 'abc$¢€xyz' REGEXP '^abc[\u0024][\u00a2][\u20ac]xyz$', 'abc$¢€xyz' REGEXP '^abc[\u0024\u00A2\u20AC]{3}xyz$', - 'abc$¢€xyz' REGEXP '^abc[\x24][\xa2\x20ac]+xyz$' + 'abc$¢€xyz' REGEXP '^abc[\x24][\xa2\u20ac]+xyz$' } {1 1 1} do_execsql_test regexp1-2.22 { SELECT 'abc$¢€xyz' REGEXP '^abc[^\u0025-X][^ -\u007f][^\u20ab]xyz$' } {1}