agentzh / lua-resty-multipart-parser

Simple multipart data parser for OpenResty/Lua
39 stars 18 forks source link

pcre error #2

Closed hy05190134 closed 7 years ago

hy05190134 commented 7 years ago

header =

"multipart/form-data; boundary=X3xzCbpcHmO20eREKeawv1em7LqqtVd1ebPldf; charset=UTF-8"

match_table[1] = nil
match_table[2] = nil
local m, err = re_match(header,
[[;\sboundary\s=\s(?:"([^"]+)"|([-|+$&!.%'`~^#\w]+))]],
"joi", nil, match_table)
if m then
return m[1] or m[2]. --- m[1] is nil, m[2] is nil end


header = ""

match_table[1] = nil
match_table[2] = nil
local m, err = re_match(header,
[[;\sboundary\s=\s(?:"([^"]+)"|([-|+$&!.%'`~^#\w]+))]],
"joi")
if m then
return m[1] or m[2]. --- m[1] is false, m[2] is X3xzCbpcHmO20eREKeawv1em7LqqtVd1ebPldf end

maybe it is bug, but I don't know why cause this?

@agentzh

agentzh commented 7 years ago

@hy05190134 No Chinese is allowed here. If you really want to use Chinese, please join and post to the openresty (Chinese) mailing list instead. Thanks for your cooperation. Besides, I cannot understand your description at all.

hy05190134 commented 7 years ago

I just mean why the result is different when we use the fourth and fifth params in ngx.re.match function, I have already show the result. @agentzh