/usr/share/doc/alex/html/regexps.html is in alex 3.1.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 4. Regular Expression</title><link rel="stylesheet" type="text/css" href="fptools.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Alex User Guide"><link rel="up" href="index.html" title="Alex User Guide"><link rel="prev" href="alex-files.html" title="3.2. Syntax of Alex files"><link rel="next" href="charsets.html" title="4.2. Syntax of character sets"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. Regular Expression</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="alex-files.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="charsets.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="regexps"></a>Chapter 4. Regular Expression</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="regexps.html#regexp-syntax">4.1. Syntax of regular expressions</a></span></dt><dt><span class="section"><a href="charsets.html">4.2. Syntax of character sets</a></span></dt></dl></div><p>Regular expressions are the patterns that Alex uses to match
tokens in the input stream.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="regexp-syntax"></a>4.1. Syntax of regular expressions</h2></div></div></div><pre class="programlisting">regexp := rexp2 { '|' rexp2 }
rexp2 := rexp1 { rexp1 }
rexp1 := rexp0 [ '*' | '+' | '?' | repeat ]
rexp0 := set
| @rmac
| @string
| '(' [ regexp ] ')'
repeat := '{' $digit '}'
| '{' $digit ',' '}'
| '{' $digit ',' $digit '}'</pre><p>The syntax of regular expressions is fairly standard, the
only difference from normal lex-style regular expressions being
that we allow the sequence <code class="literal">()</code> to denote the
regular expression that matches the empty string.</p><p>Spaces are ignored in a regular expression, so feel free
to space out your regular expression as much as you like, even
split it over multiple lines and include comments. Literal
whitespace can be included by surrounding it with quotes
<code class="literal">" "</code>, or by escaping each whitespace character
with <code class="literal">\</code>.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="literal"><em class="replaceable"><code>set</code></em></code></span></dt><dd><p>Matches any of the characters in
<em class="replaceable"><code>set</code></em>. See <a class="xref" href="charsets.html" title="4.2. Syntax of character sets">Section 4.2, “Syntax of character sets”</a> for the syntax of sets.</p></dd><dt><span class="term"><code class="literal">@foo</code></span></dt><dd><p>Expands to the definition of the appropriate
regular expression macro.</p></dd><dt><span class="term"><code class="literal">"..."</code></span></dt><dd><p>Matches the sequence of characters in the string, in
that order.</p></dd><dt><span class="term"><code class="literal"><em class="replaceable"><code>r</code></em>*</code></span></dt><dd><p>Matches zero or more occurrences of
<em class="replaceable"><code>r</code></em>.</p></dd><dt><span class="term"><code class="literal"><em class="replaceable"><code>r</code></em>+</code></span></dt><dd><p>Matches one or more occurrences of
<em class="replaceable"><code>r</code></em>.</p></dd><dt><span class="term"><code class="literal"><em class="replaceable"><code>r</code></em>?</code></span></dt><dd><p>Matches zero or one occurrences of
<em class="replaceable"><code>r</code></em>.</p></dd><dt><span class="term"><code class="literal"><em class="replaceable"><code>r</code></em>{<em class="replaceable"><code>n</code></em>}</code></span></dt><dd><p>Matches <em class="replaceable"><code>n</code></em> occurrences of
<em class="replaceable"><code>r</code></em>.</p></dd><dt><span class="term"><code class="literal"><em class="replaceable"><code>r</code></em>{<em class="replaceable"><code>n</code></em>,}</code></span></dt><dd><p>Matches <em class="replaceable"><code>n</code></em> or more occurrences of
<em class="replaceable"><code>r</code></em>.</p></dd><dt><span class="term"><code class="literal"><em class="replaceable"><code>r</code></em>{<em class="replaceable"><code>n</code></em>,<em class="replaceable"><code>m</code></em>}</code></span></dt><dd><p>Matches between <em class="replaceable"><code>n</code></em> and
<em class="replaceable"><code>m</code></em> (inclusive) occurrences of
<em class="replaceable"><code>r</code></em>.</p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="alex-files.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="charsets.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.2. Syntax of Alex files </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 4.2. Syntax of character sets</td></tr></table></div></body></html>
|