summaryrefslogtreecommitdiff
path: root/devdocs/elisp/standard-regexps.html
blob: 143613c56b42600dbd7c98f9b7ade591ff8fe11a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 <h3 class="section">Standard Regular Expressions Used in Editing</h3>   <p>This section describes some variables that hold regular expressions used for certain purposes in editing: </p> <dl> <dt id="page-delimiter">User Option: <strong>page-delimiter</strong>
</dt> <dd><p>This is the regular expression describing line-beginnings that separate pages. The default value is <code>"^\014"</code> (i.e., <code>"^^L"</code> or <code>"^\C-l"</code>); this matches a line that starts with a formfeed character. </p></dd>
</dl> <p>The following two regular expressions should <em>not</em> assume the match always starts at the beginning of a line; they should not use ‘<samp>^</samp>’ to anchor the match. Most often, the paragraph commands do check for a match only at the beginning of a line, which means that ‘<samp>^</samp>’ would be superfluous. When there is a nonzero left margin, they accept matches that start after the left margin. In that case, a ‘<samp>^</samp>’ would be incorrect. However, a ‘<samp>^</samp>’ is harmless in modes where a left margin is never used. </p> <dl> <dt id="paragraph-separate">User Option: <strong>paragraph-separate</strong>
</dt> <dd><p>This is the regular expression for recognizing the beginning of a line that separates paragraphs. (If you change this, you may have to change <code>paragraph-start</code> also.) The default value is <code>"[ \t\f]*$"</code>, which matches a line that consists entirely of spaces, tabs, and form feeds (after its left margin). </p></dd>
</dl> <dl> <dt id="paragraph-start">User Option: <strong>paragraph-start</strong>
</dt> <dd><p>This is the regular expression for recognizing the beginning of a line that starts <em>or</em> separates paragraphs. The default value is <code>"\f\\|[ \t]*$"</code>, which matches a line containing only whitespace or starting with a form feed (after its left margin). </p></dd>
</dl> <dl> <dt id="sentence-end">User Option: <strong>sentence-end</strong>
</dt> <dd>
<p>If non-<code>nil</code>, the value should be a regular expression describing the end of a sentence, including the whitespace following the sentence. (All paragraph boundaries also end sentences, regardless.) </p> <p>If the value is <code>nil</code>, as it is by default, then the function <code>sentence-end</code> constructs the regexp. That is why you should always call the function <code>sentence-end</code> to obtain the regexp to be used to recognize the end of a sentence. </p>
</dd>
</dl> <dl> <dt id="sentence-end">Function: <strong>sentence-end</strong>
</dt> <dd><p>This function returns the value of the variable <code>sentence-end</code>, if non-<code>nil</code>. Otherwise it returns a default value based on the values of the variables <code>sentence-end-double-space</code> (see <a href="filling#Definition-of-sentence_002dend_002ddouble_002dspace">Definition of sentence-end-double-space</a>), <code>sentence-end-without-period</code>, and <code>sentence-end-without-space</code>. </p></dd>
</dl><div class="_attribution">
  <p class="_attribution-p">
    Copyright &copy; 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/Standard-Regexps.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Standard-Regexps.html</a>
  </p>
</div>