utf8.gmatch | Multi Theft Auto: Wiki Skip to content

utf8.gmatch

Client-side
Server-side
Shared

This function returns a pattern finding iterator for UTF-8 strings. The iterator will search through the string input looking for instances of the pattern you passed. For more information on iterators read the ForTutorial and IteratorsTutorial.

Syntax

iterator utf8.gmatch ( string input, string pattern )
Required Arguments
  • input: A string character sequence.
  • pattern: A string match pattern.

Returns

  • iterator: value

Returns an function for iterations on the input string by using the passed pattern string.

Code Examples

shared

This example prints every word in the UTF-8 string.

Output: Как вас зовут

for word in utf8.gmatch("Как вас зовут?", "%a+") do
print(word)
end