I am trying to select lines excluding the ones defined with keywords Cockos|VSTi|mono|x86|midi|MIDI|\\[vstcache\\]
Here is the Lua Regex pattern I am using, but getting a nil when I try to gmatch in Lua script '^(?:(?!Cockos|VSTi|mono|x86|midi|MIDI|\\[vstcache\\]).)*$\\r?\\n?'
function GetPluginsTable()
local context = ''
local plugins_info = reaper.GetResourcePath()..'\\'..'reaper-vstplugins64.ini'
f=io.open(plugins_info, 'r')
if f then context = f:read('a') else return end
f:close()
local tbl = {}
local pattern = '^(?:(?!Cockos|VSTi|mono|x86|midi|MIDI|\\[vstcache\\]).)*$\\r?\\n?'
for line in context:gmatch(pattern) do tbl[#t+1] = line end
return tbl
end
local table = GetPluginsTable()
print(#table) -- I am getting nil pattern not matching???
Here is what I got in the reaper-vstplugins64.ini
file that I am using the regular expressions on to selectively pick certain lines.
[vstcache]
reacast.dll=0088CADF36B2D801,1919246691,ReaCast (Cockos)
HoRNetTape_x64.vst3=000AF857F855D301,1773538056{F2AEE70D00DE4F4E48724E7454617065,HoRNetTape (HoRNet)
Kombinat_Tri.vst3=0041BA4D3D18D301,1880843185{5653544B6F6D336B6F6D62696E617420,Kombinat Tri (Audio Damage, Inc.) (mono)
Kontakt.vst3=0018E9A73448D801,821777587{5653544E6924446B6F6E74616B740000,Kontakt (Native Instruments) (64 out)!!!VSTi
GGain.dll=241679B662F2D601,1735999850,GGain (GVST)
I need the lines defined with keywords and also parse each line so the result in this case is
HoRNetTape
Kombinat Tri
These results are the name field after the second comma.
when filtering out lines that has these keywords Cockos VSTi mono x86 midi MIDI vstcache