Utf8.gmatch
Jump to navigation
Jump to search
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
Returns an function for iterations on the input string by using the passed pattern string.
Example
Click to collapse [-]
ServerThis example prints every word in the UTF-8 string
for word in utf8.gmatch( "Как вас зовут?", "%a+" ) do print( word ) end
Output:
Как вас зовут
See Also
- utf8.byte
- utf8.char
- utf8.charpos
- utf8.escape
- utf8.find
- utf8.fold
- utf8.gmatch
- utf8.gsub
- utf8.insert
- utf8.len
- utf8.lower
- utf8.match
- utf8.ncasecmp
- utf8.next
- utf8.remove
- utf8.reverse
- utf8.sub
- utf8.title
- utf8.upper
- utf8.width
- utf8.widthindex