427
427
--- response_body_like chop
428
error: pcre_exec\(\) failed: -10 on "你.*?" using "你好"
428
error: pcre_exec\(\) failed: -10
435
=== TEST 21: UTF-8 mode without UTF-8 sequence checks
439
local s, n, err = ngx.re.gsub("你好", ".", "a", "U")
446
probe process("$LIBPCRE_PATH").function("pcre_compile") {
447
printf("compile opts: %x\n", $options)
450
probe process("$LIBPCRE_PATH").function("pcre_exec") {
451
printf("exec opts: %x\n", $options)
469
=== TEST 22: UTF-8 mode with UTF-8 sequence checks
473
local s, n, err = ngx.re.gsub("你好", ".", "a", "u")
480
probe process("$LIBPCRE_PATH").function("pcre_compile") {
481
printf("compile opts: %x\n", $options)
484
probe process("$LIBPCRE_PATH").function("pcre_exec") {
485
printf("exec opts: %x\n", $options)
503
=== TEST 23: just hit match limit
505
lua_regex_match_limit 5600;
508
content_by_lua_file html/a.lua;
513
local re = [==[(?i:([\s'\"`´’‘\(\)]*)?([\d\w]+)([\s'\"`´’‘\(\)]*)?(?:=|<=>|r?like|sounds\s+like|regexp)([\s'\"`´’‘\(\)]*)?\2|([\s'\"`´’‘\(\)]*)?([\d\w]+)([\s'\"`´’‘\(\)]*)?(?:!=|<=|>=|<>|<|>|\^|is\s+not|not\s+like|not\s+regexp)([\s'\"`´’‘\(\)]*)?(?!\6)([\d\w]+))]==]
515
s = string.rep([[ABCDEFG]], 10)
517
local start = ngx.now()
519
local res, cnt, err = ngx.re.gsub(s, re, "", "o")
523
local elapsed = ngx.now() - start
524
ngx.say(elapsed, " sec elapsed.")
528
ngx.say("error: ", err)
531
ngx.say("gsub: ", cnt)
536
error: pcre_exec() failed: -8
540
=== TEST 24: just not hit match limit
542
lua_regex_match_limit 5700;
545
content_by_lua_file html/a.lua;
550
local re = [==[(?i:([\s'\"`´’‘\(\)]*)?([\d\w]+)([\s'\"`´’‘\(\)]*)?(?:=|<=>|r?like|sounds\s+like|regexp)([\s'\"`´’‘\(\)]*)?\2|([\s'\"`´’‘\(\)]*)?([\d\w]+)([\s'\"`´’‘\(\)]*)?(?:!=|<=|>=|<>|<|>|\^|is\s+not|not\s+like|not\s+regexp)([\s'\"`´’‘\(\)]*)?(?!\6)([\d\w]+))]==]
552
local s = string.rep([[ABCDEFG]], 10)
554
local start = ngx.now()
556
local res, cnt, err = ngx.re.gsub(s, re, "", "o")
560
local elapsed = ngx.now() - start
561
ngx.say(elapsed, " sec elapsed.")
565
ngx.say("error: ", err)
568
ngx.say("gsub: ", cnt)