diff options
author | Piotr Strzelczyk <piotr@eps.gda.pl> | 2011-05-30 14:34:00 +0000 |
---|---|---|
committer | Piotr Strzelczyk <piotr@eps.gda.pl> | 2011-05-30 14:34:00 +0000 |
commit | c32428439752f27f05c6afef8b4544358a3a1e51 (patch) | |
tree | 5a5b4398a5d5fc1f6af3c3b32cf56c578c0354a8 /Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/Regularexpressions.html | |
parent | 05efb6b17f296f79be8b576c90f3fce7cb6750d4 (diff) |
texworks 0.4.1
git-svn-id: svn://tug.org/texlive/trunk@22686 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/Regularexpressions.html')
-rw-r--r-- | Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/Regularexpressions.html | 219 |
1 files changed, 110 insertions, 109 deletions
diff --git a/Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/Regularexpressions.html b/Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/Regularexpressions.html index f5e32440f16..3b5e382c48d 100644 --- a/Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/Regularexpressions.html +++ b/Master/tlpkg/texworks/texworks-help/TeXworks-manual/en/Regularexpressions.html @@ -16,14 +16,14 @@ "TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" /> <!-- info,2,imgdir:images/,sec-filename,next,index=2,url-enc,html --> <meta name="src" content="index.tex" /> -<meta name="date" content="2011-03-20 12:48:00" /> +<meta name="date" content="2011-05-26 18:30:00" /> <link rel="stylesheet" type="text/css" href="index.css" /> <style type="text/css" xml:space="preserve"> /*<![CDATA[*/ - tr.c14 {vertical-align:baseline;} - td.c13 {white-space:wrap; text-align:left;} - td.c12 {white-space:nowrap; text-align:left;} - div.c11 {white-space:nowrap; text-align:left;} + tr.c15 {vertical-align:baseline;} + td.c14 {white-space:wrap; text-align:left;} + td.c13 {white-space:nowrap; text-align:left;} + div.c12 {white-space:nowrap; text-align:left;} /*]]>*/ </style> </head> @@ -106,7 +106,7 @@ sets</h3><a id="dx43-53001" name="dx43-53001"></a> <!--l. 20--> <p class="noindent">When using regexps, one very often has to create a search expession which represents other strings in a -generic way. If you are looking for a string which matches email +generic way. If you are looking for a string that matches email addresses, for example, the letters and symbols will vary; still, you could search for any string which corresponds to the structure of an email address @@ -117,7 +117,7 @@ figures, symbols, … <!--l. 22--></p> <p class="indent">These codes replace and facilitate the definition of sets; for example, to instead of manually defining the set of digits <b>[0-9]</b>, one can use “<b>\d</b>”. The following table -lists the replacement codes. <span class="footnote-mark"><a href= +lists the replacement codes.<span class="footnote-mark"><a href= "index47.html#fn4x10"><sup class= "textsuperscript">4</sup></a></span><a id="x43-53002f4" name= "x43-53002f4"></a> <!--l. 25--></p> @@ -131,29 +131,29 @@ lists the replacement codes. <span class="footnote-mark"><a href= <col id="TBL-9-2" /> </colgroup> -<tr class="c14" id="TBL-9-1-"> -<td id="TBL-9-1-1" class="td11 c12"> -<div class="multicolumn c11"> +<tr class="c15" id="TBL-9-1-"> +<td id="TBL-9-1-1" class="td11 c13"> +<div class="multicolumn c12"> Element </div> </td> -<td id="TBL-9-1-2" class="td11 c13"> +<td id="TBL-9-1-2" class="td11 c14"> <!--l. 27--> <p class="noindent">Meaning</p> </td> </tr> -<tr class="c14" id="TBL-9-2-"> -<td id="TBL-9-2-1" class="td11 c13"> +<tr class="c15" id="TBL-9-2-"> +<td id="TBL-9-2-1" class="td11 c14"> <!--l. 29--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">c</span></p> </td> -<td id="TBL-9-2-2" class="td11 c13"> +<td id="TBL-9-2-2" class="td11 c14"> <!--l. 29--> <p class="noindent">Any character represents itself unless it has a @@ -161,15 +161,15 @@ special regexp meaning. Thus c matches the character c.</p> </td> </tr> -<tr class="c14" id="TBL-9-3-"> -<td id="TBL-9-3-1" class="td11 c13"> +<tr class="c15" id="TBL-9-3-"> +<td id="TBL-9-3-1" class="td11 c14"> <!--l. 30--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">\c</span></p> </td> -<td id="TBL-9-3-2" class="td11 c13"> +<td id="TBL-9-3-2" class="td11 c14"> <!--l. 30--> <p class="noindent">A special character that follows a backslash @@ -180,15 +180,15 @@ a string you would write “<span class= </td> </tr> -<tr class="c14" id="TBL-9-4-"> -<td id="TBL-9-4-1" class="td11 c13"> +<tr class="c15" id="TBL-9-4-"> +<td id="TBL-9-4-1" class="td11 c14"> <!--l. 31--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">\n</span></p> </td> -<td id="TBL-9-4-2" class="td11 c13"> +<td id="TBL-9-4-2" class="td11 c14"> <!--l. 31--> <p class="noindent">This matches the ASCII line feed character (LF, @@ -196,15 +196,15 @@ Unix newline, used in T<sub>E</sub>Xworks).</p> </td> </tr> -<tr class="c14" id="TBL-9-5-"> -<td id="TBL-9-5-1" class="td11 c13"> +<tr class="c15" id="TBL-9-5-"> +<td id="TBL-9-5-1" class="td11 c14"> <!--l. 32--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">\r</span></p> </td> -<td id="TBL-9-5-2" class="td11 c13"> +<td id="TBL-9-5-2" class="td11 c14"> <!--l. 32--> <p class="noindent">This matches the ASCII carriage return @@ -212,15 +212,15 @@ character (CR).</p> </td> </tr> -<tr class="c14" id="TBL-9-6-"> -<td id="TBL-9-6-1" class="td11 c13"> +<tr class="c15" id="TBL-9-6-"> +<td id="TBL-9-6-1" class="td11 c14"> <!--l. 33--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">\t</span></p> </td> -<td id="TBL-9-6-2" class="td11 c13"> +<td id="TBL-9-6-2" class="td11 c14"> <!--l. 33--> <p class="noindent">This matches the ASCII horizontal tab character @@ -228,15 +228,15 @@ character (CR).</p> </td> </tr> -<tr class="c14" id="TBL-9-7-"> -<td id="TBL-9-7-1" class="td11 c13"> +<tr class="c15" id="TBL-9-7-"> +<td id="TBL-9-7-1" class="td11 c14"> <!--l. 34--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">\v</span></p> </td> -<td id="TBL-9-7-2" class="td11 c13"> +<td id="TBL-9-7-2" class="td11 c14"> <!--l. 34--> <p class="noindent">This matches the ASCII vertical tab character @@ -244,15 +244,15 @@ character (CR).</p> </td> </tr> -<tr class="c14" id="TBL-9-8-"> -<td id="TBL-9-8-1" class="td11 c13"> +<tr class="c15" id="TBL-9-8-"> +<td id="TBL-9-8-1" class="td11 c14"> <!--l. 35--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">\xhhhh</span></p> </td> -<td id="TBL-9-8-2" class="td11 c13"> +<td id="TBL-9-8-2" class="td11 c14"> <!--l. 35--> <p class="noindent">This matches the Unicode character @@ -263,8 +263,8 @@ to the octal number ooo (between 0 and 0377).</p> </td> </tr> -<tr class="c14" id="TBL-9-9-"> -<td id="TBL-9-9-1" class="td11 c13"> +<tr class="c15" id="TBL-9-9-"> +<td id="TBL-9-9-1" class="td11 c14"> <!--l. 36--> <p class="noindent"><span class= @@ -272,7 +272,7 @@ to the octal number ooo (between 0 and 0377).</p> "ec-lmbx-12">(dot)</span></p> </td> -<td id="TBL-9-9-2" class="td11 c13"> +<td id="TBL-9-9-2" class="td11 c14"> <!--l. 36--> <p class="noindent">This matches any character (including newline). @@ -282,75 +282,75 @@ escape it with “<span class= </td> </tr> -<tr class="c14" id="TBL-9-10-"> -<td id="TBL-9-10-1" class="td11 c13"> +<tr class="c15" id="TBL-9-10-"> +<td id="TBL-9-10-1" class="td11 c14"> <!--l. 37--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">\d</span></p> </td> -<td id="TBL-9-10-2" class="td11 c13"> +<td id="TBL-9-10-2" class="td11 c14"> <!--l. 37--> <p class="noindent">This matches a digit.</p> </td> </tr> -<tr class="c14" id="TBL-9-11-"> -<td id="TBL-9-11-1" class="td11 c13"> +<tr class="c15" id="TBL-9-11-"> +<td id="TBL-9-11-1" class="td11 c14"> <!--l. 38--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">\D</span></p> </td> -<td id="TBL-9-11-2" class="td11 c13"> +<td id="TBL-9-11-2" class="td11 c14"> <!--l. 38--> <p class="noindent">This matches a non-digit.</p> </td> </tr> -<tr class="c14" id="TBL-9-12-"> -<td id="TBL-9-12-1" class="td11 c13"> +<tr class="c15" id="TBL-9-12-"> +<td id="TBL-9-12-1" class="td11 c14"> <!--l. 39--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">\s</span></p> </td> -<td id="TBL-9-12-2" class="td11 c13"> +<td id="TBL-9-12-2" class="td11 c14"> <!--l. 39--> <p class="noindent">This matches a white space.</p> </td> </tr> -<tr class="c14" id="TBL-9-13-"> -<td id="TBL-9-13-1" class="td11 c13"> +<tr class="c15" id="TBL-9-13-"> +<td id="TBL-9-13-1" class="td11 c14"> <!--l. 40--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">\S</span></p> </td> -<td id="TBL-9-13-2" class="td11 c13"> +<td id="TBL-9-13-2" class="td11 c14"> <!--l. 40--> <p class="noindent">This matches a non-white space.</p> </td> </tr> -<tr class="c14" id="TBL-9-14-"> -<td id="TBL-9-14-1" class="td11 c13"> +<tr class="c15" id="TBL-9-14-"> +<td id="TBL-9-14-1" class="td11 c14"> <!--l. 41--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">\w</span></p> </td> -<td id="TBL-9-14-2" class="td11 c13"> +<td id="TBL-9-14-2" class="td11 c14"> <!--l. 41--> <p class="noindent">This matches a word character or “<span class= @@ -358,23 +358,23 @@ escape it with “<span class= </td> </tr> -<tr class="c14" id="TBL-9-15-"> -<td id="TBL-9-15-1" class="td11 c13"> +<tr class="c15" id="TBL-9-15-"> +<td id="TBL-9-15-1" class="td11 c14"> <!--l. 42--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">\W</span></p> </td> -<td id="TBL-9-15-2" class="td11 c13"> +<td id="TBL-9-15-2" class="td11 c14"> <!--l. 42--> <p class="noindent">This matches a non-word character.</p> </td> </tr> -<tr class="c14" id="TBL-9-16-"> -<td id="TBL-9-16-1" class="td11 c13"> +<tr class="c15" id="TBL-9-16-"> +<td id="TBL-9-16-1" class="td11 c14"> <!--l. 43--> <p class="noindent"><span class= @@ -382,7 +382,7 @@ escape it with “<span class= "ec-lmbx-12">,</span> <span class="ec-lmbx-12">…</span></p> </td> -<td id="TBL-9-16-2" class="td11 c13"> +<td id="TBL-9-16-2" class="td11 c14"> <!--l. 43--> <p class="noindent">The n-th back-reference, e.g. <span class= @@ -392,8 +392,8 @@ replacement string with capturing patterns—see below</p> </td> </tr> -<tr class="c14" id="TBL-9-17-"> -<td id="TBL-9-17-1" class="td11 c13"></td> +<tr class="c15" id="TBL-9-17-"> +<td id="TBL-9-17-1" class="td11 c14"></td> </tr> </table> </div><!--l. 48--> @@ -427,14 +427,15 @@ called “quantifier”: <b>a{1,1}</b> means at least one and only one two, the integer numbers between 0 and 99. But this will match any group of 1 or 2 digits within any arbitrary string (which may have a lot of text before and after the integer); if we want this to -match only if the whole string constists <em>entirely</em> of 1 or -2 digits (without any other characters preceding or following -them), we can write the regular expression as <b>^[0-9]{1,2}$</b>; -here, <b>^</b> says that any match must start at the first -character of the string, while the <b>$</b> says that any match -must end at the last character of the string, so the string can -only be comprised of one or two digits (<b>^</b> and <b>$</b> are -so-called “assertions”—more on them later). <!--l. 62--></p> +match only if the whole string consists <em>entirely</em> of 1 or 2 +digits (without any other characters preceding or following them), +we can rewrite the regular expression to read <b>^[0-9]{1,2}$</b>; +here, the <b>^</b> specifies that any match must start at the first +character of the string, while the <b>$</b> says that any matching +substring must end at the last character of the string, so the +string can only be comprised of one or two digits (<b>^</b> and +<b>$</b> are so-called “assertions”—more on them later). +<!--l. 62--></p> <p class="indent">Here is a table of quantifiers.<span class= "footnote-mark"><a href="index48.html#fn5x10"><sup class= @@ -451,15 +452,15 @@ abbreviation, set). <!--l. 65--></p> <col id="TBL-10-2" /> </colgroup> -<tr class="c14" id="TBL-10-1-"> -<td id="TBL-10-1-1" class="td11 c13"> +<tr class="c15" id="TBL-10-1-"> +<td id="TBL-10-1-1" class="td11 c14"> <!--l. 67--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">E{n,m}</span></p> </td> -<td id="TBL-10-1-2" class="td11 c13"> +<td id="TBL-10-1-2" class="td11 c14"> <!--l. 67--> <p class="noindent">Matches at least <b>n</b> occurrences of the @@ -467,15 +468,15 @@ expression and at most <b>m</b> occurrences of the expression.</p> </td> </tr> -<tr class="c14" id="TBL-10-2-"> -<td id="TBL-10-2-1" class="td11 c13"> +<tr class="c15" id="TBL-10-2-"> +<td id="TBL-10-2-1" class="td11 c14"> <!--l. 68--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">E{n}</span></p> </td> -<td id="TBL-10-2-2" class="td11 c13"> +<td id="TBL-10-2-2" class="td11 c14"> <!--l. 68--> <p class="noindent">Matches exactly <b>n</b> occurrences of the @@ -484,15 +485,15 @@ expression n times.</p> </td> </tr> -<tr class="c14" id="TBL-10-3-"> -<td id="TBL-10-3-1" class="td11 c13"> +<tr class="c15" id="TBL-10-3-"> +<td id="TBL-10-3-1" class="td11 c14"> <!--l. 69--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">E{n,}</span></p> </td> -<td id="TBL-10-3-2" class="td11 c13"> +<td id="TBL-10-3-2" class="td11 c14"> <!--l. 69--> <p class="noindent">Matches at least <b>n</b> occurrences of the @@ -500,15 +501,15 @@ expression.</p> </td> </tr> -<tr class="c14" id="TBL-10-4-"> -<td id="TBL-10-4-1" class="td11 c13"> +<tr class="c15" id="TBL-10-4-"> +<td id="TBL-10-4-1" class="td11 c14"> <!--l. 70--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">E{,m}</span></p> </td> -<td id="TBL-10-4-2" class="td11 c13"> +<td id="TBL-10-4-2" class="td11 c14"> <!--l. 70--> <p class="noindent">Matches at most <b>m</b> occurrences of the @@ -516,15 +517,15 @@ expression.</p> </td> </tr> -<tr class="c14" id="TBL-10-5-"> -<td id="TBL-10-5-1" class="td11 c13"> +<tr class="c15" id="TBL-10-5-"> +<td id="TBL-10-5-1" class="td11 c14"> <!--l. 71--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">E?</span></p> </td> -<td id="TBL-10-5-2" class="td11 c13"> +<td id="TBL-10-5-2" class="td11 c14"> <!--l. 71--> <p class="noindent">Matches zero or one occurrence of E. This @@ -534,15 +535,15 @@ quantifier effectively means <em>the expression is optional</em> </td> </tr> -<tr class="c14" id="TBL-10-6-"> -<td id="TBL-10-6-1" class="td11 c13"> +<tr class="c15" id="TBL-10-6-"> +<td id="TBL-10-6-1" class="td11 c14"> <!--l. 72--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">E+</span></p> </td> -<td id="TBL-10-6-2" class="td11 c13"> +<td id="TBL-10-6-2" class="td11 c14"> <!--l. 72--> <p class="noindent">Matches one or more occurrences of E. This is @@ -550,15 +551,15 @@ the same as <b>E{1,}</b>.</p> </td> </tr> -<tr class="c14" id="TBL-10-7-"> -<td id="TBL-10-7-1" class="td11 c13"> +<tr class="c15" id="TBL-10-7-"> +<td id="TBL-10-7-1" class="td11 c14"> <!--l. 73--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">E*</span></p> </td> -<td id="TBL-10-7-2" class="td11 c13"> +<td id="TBL-10-7-2" class="td11 c14"> <!--l. 73--> <p class="noindent">Matches zero or more occurrences of E. This is @@ -569,8 +570,8 @@ expression is not present in the string.</p> </td> </tr> -<tr class="c14" id="TBL-10-8-"> -<td id="TBL-10-8-1" class="td11 c13"></td> +<tr class="c15" id="TBL-10-8-"> +<td id="TBL-10-8-1" class="td11 c14"></td> </tr> </table> </div> @@ -612,15 +613,15 @@ result of a search. <span class="footnote-mark"><a href= <col id="TBL-11-2" /> </colgroup> -<tr class="c14" id="TBL-11-1-"> -<td id="TBL-11-1-1" class="td11 c13"> +<tr class="c15" id="TBL-11-1-"> +<td id="TBL-11-1-1" class="td11 c14"> <!--l. 90--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">^</span></p> </td> -<td id="TBL-11-1-2" class="td11 c13"> +<td id="TBL-11-1-2" class="td11 c14"> <!--l. 90--> <p class="noindent">The caret signifies the beginning of the @@ -629,15 +630,15 @@ by writing <span class="obeylines-h verb ec-lmtt-12">\^</span></p> </td> </tr> -<tr class="c14" id="TBL-11-2-"> -<td id="TBL-11-2-1" class="td11 c13"> +<tr class="c15" id="TBL-11-2-"> +<td id="TBL-11-2-1" class="td11 c14"> <!--l. 91--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">$</span></p> </td> -<td id="TBL-11-2-2" class="td11 c13"> +<td id="TBL-11-2-2" class="td11 c14"> <!--l. 91--> <p class="noindent">The dollar signifies the end of the string. If @@ -646,30 +647,30 @@ you wish to match a literal <b>$</b>, you must escape it by writing </td> </tr> -<tr class="c14" id="TBL-11-3-"> -<td id="TBL-11-3-1" class="td11 c13"> +<tr class="c15" id="TBL-11-3-"> +<td id="TBL-11-3-1" class="td11 c14"> <!--l. 92--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">\b</span></p> </td> -<td id="TBL-11-3-2" class="td11 c13"> +<td id="TBL-11-3-2" class="td11 c14"> <!--l. 92--> <p class="noindent">A word boundary.</p> </td> </tr> -<tr class="c14" id="TBL-11-4-"> -<td id="TBL-11-4-1" class="td11 c13"> +<tr class="c15" id="TBL-11-4-"> +<td id="TBL-11-4-1" class="td11 c14"> <!--l. 93--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">\B</span></p> </td> -<td id="TBL-11-4-2" class="td11 c13"> +<td id="TBL-11-4-2" class="td11 c14"> <!--l. 93--> <p class="noindent">A non-word boundary. This assertion is true @@ -678,15 +679,15 @@ false.</p> </td> </tr> -<tr class="c14" id="TBL-11-5-"> -<td id="TBL-11-5-1" class="td11 c13"> +<tr class="c15" id="TBL-11-5-"> +<td id="TBL-11-5-1" class="td11 c14"> <!--l. 94--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">(?=E)</span></p> </td> -<td id="TBL-11-5-2" class="td11 c13"> +<td id="TBL-11-5-2" class="td11 c14"> <!--l. 94--> <p class="noindent">Positive lookahead. This assertion is true if @@ -694,15 +695,15 @@ the expression <b>E</b> matches at this point.</p> </td> </tr> -<tr class="c14" id="TBL-11-6-"> -<td id="TBL-11-6-1" class="td11 c13"> +<tr class="c15" id="TBL-11-6-"> +<td id="TBL-11-6-1" class="td11 c14"> <!--l. 95--> <p class="noindent"><span class= "obeylines-h verb ec-lmtt-12">(?!E)</span></p> </td> -<td id="TBL-11-6-2" class="td11 c13"> +<td id="TBL-11-6-2" class="td11 c14"> <!--l. 95--> <p class="noindent">Negative lookahead. This assertion is true if @@ -710,8 +711,8 @@ the expression <b>E</b> does not match at this point.</p> </td> </tr> -<tr class="c14" id="TBL-11-7-"> -<td id="TBL-11-7-1" class="td11 c13"></td> +<tr class="c15" id="TBL-11-7-"> +<td id="TBL-11-7-1" class="td11 c14"></td> </tr> </table> </div><!--l. 100--> |