string.match help

So I was trying to create a recursive thing to detect includes in code. Unfortunately, it only finds the first pattern match and not the rest.

If I do
local anticheat = “include(“blah.lua”) include(“moreblah.lua”)”

print( anticheat:match( “^include%S+” ) )
The output is

I need it to output everything found with that pattern, am I doing anything wrong or what do I do?

^ means it will only match at the start of the string, remove it and it should work (unless there’s something else I’m overseeing)

It still doesn’t work.

anticheat:match( “include%(”[%w_%.]-"%)" )
Try that.

Still no success.


Nevermind, string.match has start indexes. Thanks for your help!