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 » Scripting Helpers
Home Search
 

gMatch

Previous Thread :: Next Thread 
shonclub is not online. shonclub
Joined: 05 Sep 2009
Total Posts: 1331
22 Sep 2013 10:43 AM
Can someone explain this in a way that noobs(me) can understand?
I looked at wiki and it looked like.... I don't even know what to call it...
HELP!
Report Abuse
Apatheia is not online. Apatheia
Joined: 16 Aug 2013
Total Posts: 198
22 Sep 2013 10:47 AM
It's like match but it returns a iterator function that returns a match of the pattern everytime it's called until there are no more matches.

Report Abuse
Apatheia is not online. Apatheia
Joined: 16 Aug 2013
Total Posts: 198
22 Sep 2013 11:03 AM
Here I recreated it.

function gmatch(str, pattern)
local str = str
function match(pattern)
local result = str:match(pattern)
str = str:sub(select(2, str:find(pattern))+1, -1)
return result
end
return match, pattern, str
end

for match in gmatch("Hola mundo", "%w+") do
print(match)
end
Report Abuse
shonclub is not online. shonclub
Joined: 05 Sep 2009
Total Posts: 1331
22 Sep 2013 11:26 AM
uhhh, string.gmatch you mean? :P
Report Abuse
jnickib is not online. jnickib
Joined: 28 May 2012
Total Posts: 137
22 Sep 2013 11:27 AM
Come to my extremely realistic Minecraft game!


p.s. http://wiki.roblox.com/index.php/String.gmatch#string.gmatch_.28s.2C_pattern.29
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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