This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Program: Lua String Match Func | |
-- Purpose: To help in tokenizers and stuff. This is a pretty tiny function that allows you to match for custom strings (of course it also has perfect escape-character support.) | |
-- Returns number start_pos, number end_pos, string match | |
-- Vurv Update 0.2.0 12/25/2020 | |
-- Make sure quote and escape don't interfere with lua patterns. | |
local function match_str(self,quote,escape,pos) | |
local matched = false | |
local exp = string.format( "^[%s](.-)([%s]-)%s",quote,escape,quote ) | |
local matches = {} |