starwing / luautf8

a utf-8 support module for Lua and LuaJIT.
MIT License
412 stars 68 forks source link

match failing #8

Closed aryajur closed 8 years ago

aryajur commented 8 years ago
ut = require("lua-utf8")
print(ut.match("北京奥贝克电子股份有限公司(补证)",".-%(.-%)%s*$"))   -- Returns nil
print(string.match("Absadlhsfjh (jas) ",".-%(.-%)%s*$"))   -- Returns Absadlhsfjh (jas)
starwing commented 8 years ago

the first one, you used full width char which isn't half width char you want match second is right, you matched whole thing, and doesnt use capture.

aryajur commented 8 years ago

Thanks you are right, just visually looked similar.