Splawsh Posted May 16, 2020 Share Posted May 16, 2020 Hello all I want a Suitable pattern for get everything (word,letters,number,symbol,emoji,Letters of other languages) from input (gg.prompt) for using in this code :: input = gg.prompt({"input text"},nil,{'text'}) local str = input[1] str = str:gsub("a Pattern for here(ex:: %S*)", {['hi'] = 'Hello', ['a'] = '9805', ['s'] = '2495', [':('] = '', [''] = ':D', ['9999'] = 'Error', ['5'] = '=]'}) gg.alert("Repaced\n"..input[1].."\nto\n"..str) print(str) for example if input = ("hi as 9999 5") replacing to ("Hello 98052495 : D Error =]") but ("%S*") is not a Suitable pattern I will be happy if you help me :)) if (a person hep me) then print("Thanks U❤") os.exit() end Link to comment Share on other sites More sharing options...
Administrators Enyby Posted May 16, 2020 Administrators Share Posted May 16, 2020 No such pattern exists. You need gsub in loop for each case. Escape each key as pattern, pass to gsub with replace value. Link to comment Share on other sites More sharing options...
Question
Splawsh
Hello all
I want a Suitable pattern for get everything (word,letters,number,symbol,emoji,Letters of other languages) from input (gg.prompt)
for using in this code ::
for example if input = ("hi as 9999 5")
replacing to ("Hello 98052495 : D Error =]")
but ("%S*") is not a Suitable pattern
I will be happy if you help me :))
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.