forked from dail8859/LuaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMatch.lua
More file actions
29 lines (24 loc) · 911 Bytes
/
Copy pathMatch.lua
File metadata and controls
29 lines (24 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
-- 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.
--
-- @classmod Match
-- @see Editor:match
--
-- @usage for m in editor:match("teh") do
-- m:replace("the")
-- end
--- Beginning position of the located match.
-- @tparam[readonly] int pos
--- Length of text matched.
-- @tparam[readonly] int len
--- The actual text matched.
-- @tparam[readonly] string text
--- Replaces the matched text.
-- @function replace
-- @tparam string text replacement text
--- String representation of the match.
-- @function __tostring