Class Match
Used for searching and replacing text.
A match generator is returned from Editor:match which can
be used to iterate search results. While looping through matches, if the document is modified by any
method other than the match object's replace method, this may cause the match generator to lose its
place. Also, do not attempt to store the match object for later access outside the loop; it will not
be usable.
See also:
Usage:
for m in editor:match("teh") do
m:replace("the")
end
-
Match.pos
-
Beginning position of the located match.
-
Match.len
-
Length of text matched.
-
Match.text
-
The actual text matched.
-
Match:replace(text)
-
Replaces the matched text.
Parameters:
- text
string
replacement text
-
Match:__tostring()
-
String representation of the match.