blob: 989beca6fe8c3ba8aa27dffe0d566c950d25729a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
<h3 class="section">POSIX Regular Expression Searching</h3> <p>The usual regular expression functions do backtracking when necessary to handle the ‘<samp>\|</samp>’ and repetition constructs, but they continue this only until they find <em>some</em> match. Then they succeed and report the first match found. </p> <p>This section describes alternative search functions which perform the full backtracking specified by the POSIX standard for regular expression matching. They continue backtracking until they have tried all possibilities and found all matches, so they can report the longest match, as required by POSIX. This is much slower, so use these functions only when you really need the longest match. </p> <p>The POSIX search and match functions do not properly support the non-greedy repetition operators (see <a href="regexp-special">non-greedy</a>). This is because POSIX backtracking conflicts with the semantics of non-greedy repetition. </p> <dl> <dt id="posix-search-forward">Command: <strong>posix-search-forward</strong> <em>regexp &optional limit noerror count</em>
</dt> <dd><p>This is like <code>re-search-forward</code> except that it performs the full backtracking specified by the POSIX standard for regular expression matching. </p></dd>
</dl> <dl> <dt id="posix-search-backward">Command: <strong>posix-search-backward</strong> <em>regexp &optional limit noerror count</em>
</dt> <dd><p>This is like <code>re-search-backward</code> except that it performs the full backtracking specified by the POSIX standard for regular expression matching. </p></dd>
</dl> <dl> <dt id="posix-looking-at">Function: <strong>posix-looking-at</strong> <em>regexp</em>
</dt> <dd><p>This is like <code>looking-at</code> except that it performs the full backtracking specified by the POSIX standard for regular expression matching. </p></dd>
</dl> <dl> <dt id="posix-string-match">Function: <strong>posix-string-match</strong> <em>regexp string &optional start</em>
</dt> <dd><p>This is like <code>string-match</code> except that it performs the full backtracking specified by the POSIX standard for regular expression matching. </p></dd>
</dl><div class="_attribution">
<p class="_attribution-p">
Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
<a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/POSIX-Regexps.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/POSIX-Regexps.html</a>
</p>
</div>
|