Utf8.match

From GiderosMobile
Revision as of 15:32, 13 July 2023 by Hgy29 (talk | contribs) (Text replacement - "<source" to "<syntaxhighlight")


Available since: Gideros 2016.06
Class: utf8

Description

Looks for the first match of pattern in the string s. If it finds one, then match returns the captures from the pattern; otherwise it returns nil. If pattern specifies no captures, then the whole match is returned. A third, optional numerical argument init specifies where to start the search; its default value is 1 and can be negative. <syntaxhighlight lang="lua"> (strings) = utf8.match(s,pattern,init) </source>

Parameters

s: (string)
pattern: (string)
init: (number) optional

Return values

Returns (strings) captures