Garry's Mod Wiki


function string.gfind( string data, string pattern )


We advise against using this. It may be changed or removed in a future update. This function is removed in Lua versions later than what GMod is currently using. Use string.gmatch instead.

Returns an iterator function that is called for every complete match of the pattern, all sub matches will be passed as to the loop.


1 string data
The string to search in
2 string pattern
The pattern to search for


1 function
The iterator function that can be used in a for-in loop


Example usage of the function

local s = "my awesome stuff 12" for w in string.gfind(s, "(%a)") do Msg(w) end
Output: In your console: myawesomestuff

Page Links

Special Pages



Render Time: 74ms

DB GetPage 40
Generate Html 10
SaveChanges (1) 13
Render Body 0
Render Sidebar 8