Revision: 4743 http://geany.svn.sourceforge.net/geany/?rev=4743&view=rev Author: ntrel Date: 2010-03-08 17:03:03 +0000 (Mon, 08 Mar 2010)
Log Message: ----------- Update for POSIX-regexes.
Modified Paths: -------------- branches/gnu-regex/ChangeLog branches/gnu-regex/doc/geany.html branches/gnu-regex/doc/geany.txt
Modified: branches/gnu-regex/ChangeLog =================================================================== --- branches/gnu-regex/ChangeLog 2010-03-08 16:27:51 UTC (rev 4742) +++ branches/gnu-regex/ChangeLog 2010-03-08 17:03:03 UTC (rev 4743) @@ -9,6 +9,8 @@ * src/search.c: Implement POSIX-regex Replace All (could be more efficient but seems OK for now). + * doc/geany.txt, doc/geany.html: + Update for POSIX-regexes.
2010-03-02 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: branches/gnu-regex/doc/geany.html =================================================================== --- branches/gnu-regex/doc/geany.html 2010-03-08 16:27:51 UTC (rev 4742) +++ branches/gnu-regex/doc/geany.html 2010-03-08 17:03:03 UTC (rev 4743) @@ -6,7 +6,7 @@ <meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> <title>Geany</title> <meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz" /> -<meta name="date" content="2010-02-21" /> +<meta name="date" content="2010-02-24" /> <style type="text/css">
/* @@ -139,7 +139,7 @@ <br />Nick Treleaven <br />Frank Lanitz</td></tr> <tr><th class="docinfo-name">Date:</th> -<td>2010-02-21</td></tr> +<td>2010-02-24</td></tr> <tr><th class="docinfo-name">Version:</th> <td>0.19</td></tr> </tbody> @@ -1507,9 +1507,13 @@ <img alt="./images/find_dialog.png" src="./images/find_dialog.png" /> <div class="section"> <h4><a class="toc-backref" href="#id64" id="matching-options" name="matching-options">Matching options</a></h4> -<p>The syntax for the Use regular expressions option is shown in +<p>The syntax for the <em>Use regular expressions</em> option is shown in <a class="reference" href="#regular-expressions">Regular expressions</a>.</p> -<p>The Use escape sequences option will transform any escaped characters +<div class="note"> +<p class="first admonition-title">Note</p> +<p class="last"><em>Use escape sequences</em> is implied for regular expressions.</p> +</div> +<p>The <em>Use escape sequences</em> option will transform any escaped characters into their UTF-8 equivalent. For example, \t will be transformed into a tab character. Other recognized symbols are: \, \n, \r, \uXXXX (Unicode characters).</p> @@ -1633,23 +1637,18 @@ <div class="section"> <h3><a class="toc-backref" href="#id75" id="regular-expressions" name="regular-expressions">Regular expressions</a></h3> <p>You can use regular expressions in the Find and Replace dialogs -by selecting the Use regular expressions check box. The syntax is -POSIX-like, as described in the table below.</p> +by selecting the <em>Use regular expressions</em> check box (see <a class="reference" href="#matching-options">Matching +options</a>). The syntax is POSIX compatible, as described in the table +below.</p> <div class="note"> <p class="first admonition-title">Note</p> -<ol class="last arabic simple"> -<li>Searching backwards with regular expressions is not supported.</li> -<li>\r and \n are never matched because regular expression -searches are made line per line (stripped of end-of-line chars).</li> -<li>The POSIX '?' regular expression character for optional -matching is not supported.</li> -</ol> +<p class="last">Searching backwards with regular expressions is not supported.</p> </div> <p><strong>In a regular expression, the following characters are interpreted:</strong></p> <table border="1" class="docutils"> <colgroup> -<col width="8%" /> -<col width="92%" /> +<col width="10%" /> +<col width="90%" /> </colgroup> <tbody valign="top"> <tr><td>.</td> @@ -1667,11 +1666,11 @@ Fred([1-9])XXX and the replace string was Sam\1YYY, when applied to Fred2XXX this would generate Sam2YYY.</td> </tr> -<tr><td><</td> -<td>This matches the start of a word.</td> +<tr><td>\0</td> +<td>When replacing, the whole matching text.</td> </tr> -<tr><td>></td> -<td>This matches the end of a word.</td> +<tr><td>\b</td> +<td>This matches a word boundary.</td> </tr> <tr><td>\c</td> <td><p class="first">A backslash followed by d, D, s, S, w or W, becomes a @@ -1681,8 +1680,8 @@ <li>D: any char except decimal digits</li> <li>s: whitespace (space, \t \n \r \f \v)</li> <li>S: any char except whitespace (see above)</li> -<li>w: alphanumeric & underscore (changed by user setting)</li> -<li>W: any char except alphanumeric & underscore (see above)</li> +<li>w: alphanumeric & underscore</li> +<li>W: any char except alphanumeric & underscore</li> </ul> </td> </tr> @@ -1692,25 +1691,25 @@ and not as the start of a character set. Use \ for a literal backslash.</td> </tr> -<tr><td>\xHH</td> -<td>A backslash followed by x and two hexa digits, becomes the -character whose Ascii code is equal to these digits. If not -followed by two digits, it is 'x' char itself.</td> +<tr><td>\uHHHH</td> +<td>A backslash followed by u and one, two or four hexa digits, +becomes the character whose Unicode is equal to these digits.</td> </tr> <tr><td>[...]</td> <td><p class="first">Matches one of the characters in the set. If the first character in the set is ^, it matches the characters NOT in the set, i.e. complements the set. A shorthand S-E (start dash end) is used to specify a set of characters S up to E, -inclusive. The special characters ] and - have no special -meaning if they appear as the first chars in the set. To -include both, put - first: [-]A-Z] (or just backslash them).</p> +inclusive.</p> +<p>The special characters ] and - have no special +meaning if they appear first in the set. - can also be last +in the set. To include both, put ] first: []A-Z-].</p> <p>Examples:</p> <pre class="last literal-block"> -[-]|] matches these 3 chars +[]|-] matches these 3 chars []-|] matches from ] to | chars [a-z] any lowercase alpha -[^-]] any char except - and ] +[^]-] any char except - and ] [^A-Z] any char except uppercase alpha [a-zA-Z] any alpha </pre> @@ -1731,6 +1730,9 @@ <td>This matches 1 or more times. For example, Sa+m matches Sam, Saam, Saaam and so on.</td> </tr> +<tr><td>?</td> +<td>This matches 0 or 1 time(s). For example, Joh?n matches John, Jon.</td> +</tr> </tbody> </table> <div class="note"> @@ -5932,7 +5934,7 @@ <div class="footer"> <hr class="footer" /> <a class="reference" href="geany.txt">View document source</a>. -Generated on: 2010-02-24 15:04 UTC. +Generated on: 2010-03-08 16:57 UTC. Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
Modified: branches/gnu-regex/doc/geany.txt =================================================================== --- branches/gnu-regex/doc/geany.txt 2010-03-08 16:27:51 UTC (rev 4742) +++ branches/gnu-regex/doc/geany.txt 2010-03-08 17:03:03 UTC (rev 4743) @@ -1127,10 +1127,13 @@ Matching options ````````````````
-The syntax for the Use regular expressions option is shown in +The syntax for the *Use regular expressions* option is shown in `Regular expressions`_.
-The Use escape sequences option will transform any escaped characters +.. note:: + *Use escape sequences* is implied for regular expressions. + +The *Use escape sequences* option will transform any escaped characters into their UTF-8 equivalent. For example, \t will be transformed into a tab character. Other recognized symbols are: \\, \n, \r, \uXXXX (Unicode characters). @@ -1286,19 +1289,16 @@ ^^^^^^^^^^^^^^^^^^^
You can use regular expressions in the Find and Replace dialogs -by selecting the Use regular expressions check box. The syntax is -POSIX-like, as described in the table below. +by selecting the *Use regular expressions* check box (see `Matching +options`_). The syntax is POSIX compatible, as described in the table +below.
.. note:: - (1) Searching backwards with regular expressions is not supported. - (2) \r and \n are never matched because regular expression - searches are made line per line (stripped of end-of-line chars). - (3) The POSIX '?' regular expression character for optional - matching is not supported. + Searching backwards with regular expressions is not supported.
**In a regular expression, the following characters are interpreted:**
-====== ============================================================ +======= ============================================================ . Matches any character.
( This marks the start of a region for tagging a match. @@ -1310,9 +1310,9 @@ Fred([1-9])XXX and the replace string was Sam\1YYY, when applied to Fred2XXX this would generate Sam2YYY.
-\< This matches the start of a word. +\0 When replacing, the whole matching text.
-\> This matches the end of a word. +\b This matches a word boundary.
\c A backslash followed by d, D, s, S, w or W, becomes a character class (both inside and outside sets []). @@ -1321,32 +1321,33 @@ * D: any char except decimal digits * s: whitespace (space, \t \n \r \f \v) * S: any char except whitespace (see above) - * w: alphanumeric & underscore (changed by user setting) - * W: any char except alphanumeric & underscore (see above) + * w: alphanumeric & underscore + * W: any char except alphanumeric & underscore
\x This allows you to use a character x that would otherwise have a special meaning. For example, \[ would be interpreted as [ and not as the start of a character set. Use \\ for a literal backslash.
-\xHH A backslash followed by x and two hexa digits, becomes the - character whose Ascii code is equal to these digits. If not - followed by two digits, it is 'x' char itself. +\uHHHH A backslash followed by u and one, two or four hexa digits, + becomes the character whose Unicode is equal to these digits.
[...] Matches one of the characters in the set. If the first character in the set is ^, it matches the characters NOT in the set, i.e. complements the set. A shorthand S-E (start dash end) is used to specify a set of characters S up to E, - inclusive. The special characters ] and - have no special - meaning if they appear as the first chars in the set. To - include both, put - first: [-]A-Z] (or just backslash them). + inclusive.
+ The special characters ] and - have no special + meaning if they appear first in the set. - can also be last + in the set. To include both, put ] first: []A-Z-]. + Examples::
- [-]|] matches these 3 chars + []|-] matches these 3 chars []-|] matches from ] to | chars [a-z] any lowercase alpha - [^-]] any char except - and ] + [^]-] any char except - and ] [^A-Z] any char except uppercase alpha [a-zA-Z] any alpha
@@ -1360,8 +1361,10 @@
+ This matches 1 or more times. For example, Sa+m matches Sam, Saam, Saaam and so on. -====== ============================================================
+? This matches 0 or 1 time(s). For example, Joh?n matches John, Jon. +======= ============================================================ + .. note:: This table is adapted from Scintilla and SciTE documentation, distributed under the `License for Scintilla and SciTE`_.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.