|
| 29 Mar 2015 09:56 PM |
Basically, I want to know if the character is %w, or if the character is "-" specifically.
for x in string.gmatch(msg, "%w+") do table.insert(words,x) end
|
|
|
| Report Abuse |
|
|
|
| 29 Mar 2015 09:57 PM |
| Just found out that making it capital does the opposite and I fixed it thanks! |
|
|
| Report Abuse |
|
|
ChoongJae
|
  |
| Joined: 10 Oct 2009 |
| Total Posts: 670 |
|
| |
|
|
| 29 Mar 2015 10:27 PM |
| I still want to know how I do ors |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Mar 2015 10:30 PM |
What do you mean? '%w, or if the character is "-"'
If it's an alphanumerical character or a subtraction sign? local x = "abv231-132 -csa-c34-414"; for y in x:gmatch("[%w%-]+") do print(y) end
That would print: abv231-132 -csa-c34-414 |
|
|
| Report Abuse |
|
|
|
| 29 Mar 2015 10:32 PM |
I already found out what I wanted lol, but how do I do or?
like match(%w OR %a) -- for example
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Mar 2015 10:33 PM |
%w includes all letters anyways.
Can you give me an actual example, like a string and what you want to match? |
|
|
| Report Abuse |
|
|
|
| 29 Mar 2015 10:39 PM |
| I'm just looking for a way to do or matches |
|
|
| Report Abuse |
|
|
|
| 29 Mar 2015 10:40 PM |
| The problem I had is solved and I want to know this.. |
|
|
| Report Abuse |
|
|
LucasLua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7386 |
|
|
| 29 Mar 2015 10:42 PM |
I don't think you understand what you are asking?
|
|
|
| Report Abuse |
|
|
|
| 29 Mar 2015 10:45 PM |
Okay forget about everything I said before
All I want to do is know how to do or matches
for example
if num == 2 or num ==3 then
well basically, I want to know if its %d or %w -- FOR EXAMPLE so how would I do a match that is this OR that? |
|
|
| Report Abuse |
|
|
|
| 29 Mar 2015 10:46 PM |
| Not possible with default Lua functions. I can make a function for you though, if you'd like. |
|
|
| Report Abuse |
|
|
|
| 29 Mar 2015 10:47 PM |
| Thanks but, I don't need it I was just curious. |
|
|
| Report Abuse |
|
|