Should be simple to embed [fengari](https://github.com/fengari-lua/fengari) (or just rip the code out of it) to run the given lua pattern on a blob of text.