Utf8.match: Difference between revisions
From GiderosMobile
No edit summary |
No edit summary |
||
| Line 2: | Line 2: | ||
'''Available since:''' Gideros 2016.06<br/> | '''Available since:''' Gideros 2016.06<br/> | ||
=== Description === | === 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. | <translate>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.</translate> | ||
<source lang="lua"> | <source lang="lua"> | ||
(strings) = utf8.match(s,pattern,init) | (strings) = utf8.match(s,pattern,init) | ||
</source> | </source> | ||
=== Parameters === | === Parameters === | ||
'''s''': (string) | '''s''': (string) <translate></translate> <br/> | ||
'''pattern''': (string) | '''pattern''': (string) <translate></translate> <br/> | ||
'''init''': (number) | '''init''': (number) <translate></translate> '''optional'''<br/> | ||
=== Return values === | === Return values === | ||
'''Returns''' (strings) captures<br/> | '''Returns''' (strings) <translate>captures</translate><br/> | ||
Revision as of 12:33, 23 August 2018
Available since: Gideros 2016.06
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.
(strings) = utf8.match(s,pattern,init)
Parameters
s: (string)
pattern: (string)
init: (number) optional
Return values
Returns (strings) captures