generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: "or" with string patterns..?

Previous Thread :: Next Thread 
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
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
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
29 Mar 2015 09:57 PM
Just found out that making it capital does the opposite and I fixed it thanks!
Report Abuse
ChoongJae is not online. ChoongJae
Joined: 10 Oct 2009
Total Posts: 670
29 Mar 2015 09:58 PM
you're welcome
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
29 Mar 2015 10:27 PM
I still want to know how I do ors
Report Abuse
cntkillme is not online. 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
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
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 is not online. 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
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
29 Mar 2015 10:39 PM
I'm just looking for a way to do or matches
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
29 Mar 2015 10:40 PM
The problem I had is solved and I want to know this..
Report Abuse
LucasLua is not online. 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
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
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
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
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
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
29 Mar 2015 10:47 PM
Thanks but, I don't need it I was just curious.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image