Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pygy opened this issue Aug 12, 2015 · 3 comments
Closed

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

pygy opened this issue Aug 12, 2015 · 3 comments

Comments

@pygy
Copy link
Owner

pygy commented Aug 12, 2015

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.

@CapsAdmin
Copy link

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

@pygy
Copy link
Owner Author

pygy commented Apr 22, 2016

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

@pygy
Copy link
Owner Author

pygy commented Apr 22, 2016

Fixed :-)

@pygy pygy closed this as completed Apr 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants