fork download
  1. local querycreate = "create user 'dddqwd123_dwqd'@'localhost'"
  2. local create, usercreate, username, userhost = querycreate:match("^(%w+)%s+(%w+)%s+'([%w_]+)'@'(%w+)'$")
  3.  
  4. print(string.format("query: %s", querycreate))
  5. print(string.format(" var create = %s \n var usercreate = %s \n var username = %s \n var userhost = %s", create, usercreate, username, userhost))
Success #stdin #stdout 0.01s 2540KB
stdin
Standard input is empty
stdout
query: create user 'dddqwd123_dwqd'@'localhost'
 var create = create 
 var usercreate = user 
 var username = dddqwd123_dwqd 
 var userhost = localhost