|
| 1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 2 | +<html> |
| 3 | +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
| 4 | +<head> |
| 5 | + <title>LuaScript Reference</title> |
| 6 | + <link rel="stylesheet" href="../ldoc.css" type="text/css" /> |
| 7 | +</head> |
| 8 | +<body> |
| 9 | + |
| 10 | +<div id="container"> |
| 11 | + |
| 12 | +<div id="product"> |
| 13 | + <div id="product_logo"></div> |
| 14 | + <div id="product_name"><big><b></b></big></div> |
| 15 | + <div id="product_description"></div> |
| 16 | +</div> <!-- id="product" --> |
| 17 | + |
| 18 | + |
| 19 | +<div id="main"> |
| 20 | + |
| 21 | + |
| 22 | +<!-- Menu --> |
| 23 | + |
| 24 | +<div id="navigation"> |
| 25 | +<br/> |
| 26 | +<h1>LuaScript <sub>v0.4.0</sub></h1> |
| 27 | + |
| 28 | +<ul> |
| 29 | + <li><a href="../index.html">Index</a></li> |
| 30 | +</ul> |
| 31 | + |
| 32 | +<h2>Contents</h2> |
| 33 | +<ul> |
| 34 | +<li><a href="#Fields">Fields</a></li> |
| 35 | +<li><a href="#Methods">Methods</a></li> |
| 36 | +<li><a href="#Metamethods">Metamethods</a></li> |
| 37 | +</ul> |
| 38 | + |
| 39 | + |
| 40 | +<h2>Classes</h2> |
| 41 | +<ul class="nowrap"> |
| 42 | + <li><a href="../classes/Editor.html">Editor</a></li> |
| 43 | + <li><strong>Match</strong></li> |
| 44 | + <li><a href="../classes/Notepad.html">Notepad</a></li> |
| 45 | +</ul> |
| 46 | +<h2>Topics</h2> |
| 47 | +<ul class=""> |
| 48 | + <li><a href="../topics/callbacks.md.html">callbacks</a></li> |
| 49 | +</ul> |
| 50 | +<h2>Examples</h2> |
| 51 | +<ul class="nowrap"> |
| 52 | + <li><a href="../examples/bookmark.lua.html">bookmark.lua</a></li> |
| 53 | + <li><a href="../examples/highlightoccurrences.lua.html">highlightoccurrences.lua</a></li> |
| 54 | + <li><a href="../examples/selectionaddnext.lua.html">selectionaddnext.lua</a></li> |
| 55 | + <li><a href="../examples/sessionmanager.lua.html">sessionmanager.lua</a></li> |
| 56 | + <li><a href="../examples/visualstudiolinecopy.lua.html">visualstudiolinecopy.lua</a></li> |
| 57 | +</ul> |
| 58 | + |
| 59 | +</div> |
| 60 | + |
| 61 | +<div id="content"> |
| 62 | + |
| 63 | +<h1>Class <code>Match</code></h1> |
| 64 | +<p>Used for searching and replacing text.</p> |
| 65 | +<p> A match generator is returned from <a href="../classes/Editor.html#Editor:match">Editor:match</a> which can |
| 66 | + be used to iterate search results. While looping through matches, if the document is modified by any |
| 67 | + method other than the match object's replace method, this may cause the match generator to lose its |
| 68 | + place. Also, do not attempt to store the match object for later access outside the loop; it will not |
| 69 | + be usable. |
| 70 | + </p> |
| 71 | + <h3>See also:</h3> |
| 72 | + <ul> |
| 73 | + <a href="../classes/Editor.html#Editor:match">Editor:match</a> |
| 74 | + </ul> |
| 75 | + <h3>Usage:</h3> |
| 76 | + <ul> |
| 77 | + <pre class="example">for m in editor:match("teh") do m:replace("the") end</pre> |
| 78 | + </ul> |
| 79 | + |
| 80 | + |
| 81 | +<h2><a href="#Fields">Fields</a></h2> |
| 82 | +<table class="function_list"> |
| 83 | + <tr> |
| 84 | + <td class="name" nowrap><a href="#Match.pos">Match.pos</a></td> |
| 85 | + <td class="summary">Beginning position of the located match.</td> |
| 86 | + </tr> |
| 87 | + <tr> |
| 88 | + <td class="name" nowrap><a href="#Match.len">Match.len</a></td> |
| 89 | + <td class="summary">Length of text matched.</td> |
| 90 | + </tr> |
| 91 | + <tr> |
| 92 | + <td class="name" nowrap><a href="#Match.text">Match.text</a></td> |
| 93 | + <td class="summary">The actual text matched.</td> |
| 94 | + </tr> |
| 95 | +</table> |
| 96 | +<h2><a href="#Methods">Methods</a></h2> |
| 97 | +<table class="function_list"> |
| 98 | + <tr> |
| 99 | + <td class="name" nowrap><a href="#Match:replace">Match:replace(text)</a></td> |
| 100 | + <td class="summary">Replaces the matched text.</td> |
| 101 | + </tr> |
| 102 | +</table> |
| 103 | +<h2><a href="#Metamethods">Metamethods</a></h2> |
| 104 | +<table class="function_list"> |
| 105 | + <tr> |
| 106 | + <td class="name" nowrap><a href="#Match:__tostring">Match:__tostring()</a></td> |
| 107 | + <td class="summary">String representation of the match.</td> |
| 108 | + </tr> |
| 109 | +</table> |
| 110 | + |
| 111 | +<br/> |
| 112 | +<br/> |
| 113 | + |
| 114 | + |
| 115 | + <h2 class="section-header "><a name="Fields"></a>Fields</h2> |
| 116 | + |
| 117 | + <dl class="function"> |
| 118 | + <dt> |
| 119 | + <a name = "Match.pos"></a> |
| 120 | + <strong>Match.pos</strong> |
| 121 | + </dt> |
| 122 | + <dd> |
| 123 | + Beginning position of the located match. |
| 124 | + |
| 125 | + |
| 126 | + <ul> |
| 127 | + <li><span class="parameter">pos</span> |
| 128 | + <span class="types"><span class="type">int</span></span> |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | + (<em>readonly</em>) |
| 133 | + </li> |
| 134 | + </ul> |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | +</dd> |
| 141 | + <dt> |
| 142 | + <a name = "Match.len"></a> |
| 143 | + <strong>Match.len</strong> |
| 144 | + </dt> |
| 145 | + <dd> |
| 146 | + Length of text matched. |
| 147 | + |
| 148 | + |
| 149 | + <ul> |
| 150 | + <li><span class="parameter">len</span> |
| 151 | + <span class="types"><span class="type">int</span></span> |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | + (<em>readonly</em>) |
| 156 | + </li> |
| 157 | + </ul> |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | + |
| 162 | + |
| 163 | +</dd> |
| 164 | + <dt> |
| 165 | + <a name = "Match.text"></a> |
| 166 | + <strong>Match.text</strong> |
| 167 | + </dt> |
| 168 | + <dd> |
| 169 | + The actual text matched. |
| 170 | + |
| 171 | + |
| 172 | + <ul> |
| 173 | + <li><span class="parameter">text</span> |
| 174 | + <span class="types"><span class="type">string</span></span> |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | + (<em>readonly</em>) |
| 179 | + </li> |
| 180 | + </ul> |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | +</dd> |
| 187 | +</dl> |
| 188 | + <h2 class="section-header "><a name="Methods"></a>Methods</h2> |
| 189 | + |
| 190 | + <dl class="function"> |
| 191 | + <dt> |
| 192 | + <a name = "Match:replace"></a> |
| 193 | + <strong>Match:replace(text)</strong> |
| 194 | + </dt> |
| 195 | + <dd> |
| 196 | + Replaces the matched text. |
| 197 | + |
| 198 | + |
| 199 | + <h3>Parameters:</h3> |
| 200 | + <ul> |
| 201 | + <li><span class="parameter">text</span> |
| 202 | + <span class="types"><span class="type">string</span></span> |
| 203 | + replacement text |
| 204 | + </li> |
| 205 | + </ul> |
| 206 | + |
| 207 | + |
| 208 | + |
| 209 | + |
| 210 | + |
| 211 | +</dd> |
| 212 | +</dl> |
| 213 | + <h2 class="section-header "><a name="Metamethods"></a>Metamethods</h2> |
| 214 | + |
| 215 | + <dl class="function"> |
| 216 | + <dt> |
| 217 | + <a name = "Match:__tostring"></a> |
| 218 | + <strong>Match:__tostring()</strong> |
| 219 | + </dt> |
| 220 | + <dd> |
| 221 | + String representation of the match. |
| 222 | + |
| 223 | + |
| 224 | + |
| 225 | + |
| 226 | + |
| 227 | + |
| 228 | + |
| 229 | +</dd> |
| 230 | +</dl> |
| 231 | + |
| 232 | + |
| 233 | +</div> <!-- id="content" --> |
| 234 | +</div> <!-- id="main" --> |
| 235 | +<div id="about"> |
| 236 | +<i>Generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i> |
| 237 | +<i style="float:right;">Last updated 2016-09-09 09:10:16 </i> |
| 238 | +</div> <!-- id="about" --> |
| 239 | +</div> <!-- id="container" --> |
| 240 | +<footer> |
| 241 | + <a href="https://github.com/dail8859/LuaScript"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"></a> |
| 242 | +</footer> |
| 243 | +</body> |
| 244 | +</html> |
0 commit comments