pygy / strung.lua

Lua string patterns rewritten in Lua + FFI, for LuaJIT.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

For `gmatch`, the an initial "^" is not magic.

pygy opened this issue · comments

for m in strung.gmatch("a", "^a") do 
    print(m)
end

... should not print anything.

for m in strung.gmatch("^a", "^a") do 
    print(m)
end

... should print "^a".

Currently, they print "a" and nothing, respectively.

If you don't use round brackets it defaults to (^a) and not ^(a)? This seems like odd behavior on Lua's part.

Actually, the initial "^" isn't treated as a metacharacter...