• Lua pattern problem
    2 replies, posted
Hi guys Here is my problem I have addon that write to chat country of connected player, basic on [url]http://www.telize.com/geoip[/url] on my server Before site going updated string with geo information allways has format like "country":"Ukraine","region_code":"20"*** but now it can be "country":"Ukraine","isp":"UkrTelecom","region_code":"13" or "country":"Ukraine","area_coe":"44","isp":"UkrTelecom","region_code":"13" How can I cut string with infromation like this "country":"Ukraine","*, with one random letter a,r,i or other Old code [CODE]country = string.match(TheReturnedHTML,"\"country\":\".+%\",\"r")[/CODE] I tried [CODE]country = string.match(TheReturnedHTML,"\"country\":\".+%\",\"%a")[/CODE] but this doesnt help me.
local country = util.JSONToTable( TheReturnedHTML)["country"]
[QUOTE=Robotboy655;48625823]local country = util.JSONToTable( TheReturnedHTML)["country"][/QUOTE] Pretty good, thank you very much!
Sorry, you need to Log In to post a reply to this thread.