Created
January 26, 2018 14:58
-
-
Save X-Raym/9b77847c0864355f8ae99bc27915766e to your computer and use it in GitHub Desktop.
String Match with Captures Count
This file contains hidden or 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
| text = [[reaper.ShowConsoleMsg( reaper.GetActiveTake( reaper.GetItem(0,0) ) ) )]] | |
| local captures = {} | |
| for capture in string.gmatch(text, "reaper%.([%w|%d]+)") do | |
| if not captures[capture] then captures[capture] = 0 end | |
| captures[capture] = captures[capture] + 1 | |
| end | |
| for k, v in pairs( captures ) do | |
| print( k .. " = " .. v) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment