I am developing an app that receives information in Lua from a server via TCP as a string, and I would like to convert it to a Lua table and run functions from that table in my app. Here is an example of the Lua table coming from the server as a string.
return {msg_type=7, chunk=[===[user_call_back([=[{{{dir_name=[[Maintenance]]},{{ui_description=[[MPT Studio (compiled)]],put_name=[[MPT2 Instrument Verification]],put_file_utf8=[[db\tests\products\tools\MPT Instrument Verification\MPT2 Instrument Verification.mpt_productc]],avail_env={testing=1},put_file=[[ZGJcdGVzdHNccHJvZHVjdHNcdG9vbHNcTVBUIEluc3RydW1lbnQgVmVyaWZpY2F0aW9uXE1QVDIgSW5zdHJ1bWVudCBWZXJpZmljYXRpb24ubXB0X3Byb2R1Y3Rj]],put_file2=[[tools\MPT Instrument Verification\MPT2 Instrument Verification]],put_file_org=[[db\tests\products\tools\MPT Instrument Verification\MPT2 Instrument Verification.mpt_productc]]},dir_name=[[MPT Instrument Verification]]},dir_name=[[tools]]},{ui_description=[[MPT Studio]],put_name=[[mpt-remote-api]],put_file_utf8=[[db\tests\products\mpt-remote-api.mpt_product]],avail_env={testing=1},put_file=[==[ZGJcdGVzdHNccHJvZHVjdHNcbXB0LXJlbW90ZS1hcGkubXB0X3Byb2R1Y3Q=]==],put_file2=[[mpt-remote-api]],put_file_org=[[db\tests\products\mpt-remote-api.mpt_product]]},{ui_description=[[MPT Studio]],put_name=[[resistance kelvin]],put_file_utf8=[[db\tests\products\resistance kelvin.mpt_product]],avail_env={testing=1},put_file=[==[ZGJcdGVzdHNccHJvZHVjdHNccmVzaXN0YW5jZSBrZWx2aW4ubXB0X3Byb2R1Y3Q=]==],put_file2=[[resistance kelvin]],put_file_org=[[db\tests\products\resistance kelvin.mpt_product]]}}]=])]===]}
I want to extract all the file names under the put_name= category and put them in a list in a dialog box. Would the best approach be to convert the string to a table or to use string parsing tools like string.find? Would be greatly appreciated. Thank you!