/usr/share/doc/aptitude/html/en/ch02s04s01.html is in aptitude-doc-en 0.8.10-6ubuntu1.
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | <?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Searching for strings</title><link rel="stylesheet" type="text/css" href="aptitude.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="home" href="index.html" title="aptitude user's manual" /><link rel="up" href="ch02s04.html" title="Search patterns" /><link rel="prev" href="ch02s04.html" title="Search patterns" /><link rel="next" href="ch02s04s02.html" title="Shorthand for search terms" /><link rel="preface" href="pr01.html" title="Introduction" /><link rel="chapter" href="ch01.html" title="Chapter 1. Getting started" /><link rel="chapter" href="ch02.html" title="Chapter 2. aptitude reference guide" /><link rel="chapter" href="ch03.html" title="Chapter 3. aptitude frequently asked questions" /><link rel="chapter" href="ch04.html" title="Chapter 4. Credits" /><link rel="reference" href="rn01.html" title="Command-line reference" /><link rel="refentry" href="rn01re01.html" title="aptitude" /><link rel="refentry" href="rn01re02.html" title="aptitude-create-state-bundle" /><link rel="refentry" href="rn01re03.html" title="aptitude-run-state-bundle" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Searching for strings</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s04.html"><img src="images/prev.gif" alt="Prev" /></a> </td><th width="60%" align="center">Search patterns</th><td width="20%" align="right"> <a accesskey="n" href="ch02s04s02.html"><img src="images/next.gif" alt="Next" /></a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="idm2561"></a>Searching for strings</h3></div></div></div><p>
Many search terms take a string as a parameter and match it
against one or more fields of a package. Strings can be
entered either with or without double quotes
(<span class="quote">“<span class="quote"><code class="literal">"</code></span>”</span>), so
<span class="quote">“<span class="quote"><code class="literal"><code class="literal"><a class="link" href="ch02s04s05.html#searchTermName">?name</a></code>(scorch)</code></span>”</span> and
<span class="quote">“<span class="quote"><code class="literal"><code class="literal"><a class="link" href="ch02s04s05.html#searchTermName">?name</a></code>("scorch")</code></span>”</span> will
perform the same search. If you enter a search string using
double quotes, you can include a literal double-quote in the
search string by placing a backslash
(<span class="quote">“<span class="quote"><code class="literal">\</code></span>”</span>) immediately before it:
for instance,
<span class="quote">“<span class="quote"><code class="literal"><code class="literal"><a class="link" href="ch02s04s05.html#searchDescription">?description</a></code>("\"easy\"")</code></span>”</span>
will match any package whose description contains the string
<span class="quote">“<span class="quote"><code class="literal">"easy"</code></span>”</span>.
</p><p>
If you enter a <span class="quote">“<span class="quote">bare</span>”</span> string, one not
surrounded by double quotes, then <span class="command"><strong>aptitude</strong></span> will consider
the string to have <span class="quote">“<span class="quote">ended</span>”</span> when it encounters
the closing parenthesis or the comma before a second
argument to the search term.
<a href="#ftn.idm2586" class="footnote" id="idm2586"><sup class="footnote">[14]</sup></a>
To remove the special meaning of these characters, place a
tilde (<span class="quote">“<span class="quote"><code class="literal">~</code></span>”</span>) directly before
them. For instance,
<span class="quote">“<span class="quote"><code class="literal"><code class="literal"><a class="link" href="ch02s04s05.html#searchDescription">?description</a></code>(etc))</code></span>”</span> is a
syntax error, because the first
<span class="quote">“<span class="quote"><code class="literal">)</code></span>”</span> ends the <code class="literal"><a class="link" href="ch02s04s05.html#searchDescription">?description</a></code>
term, and the second <span class="quote">“<span class="quote"><code class="literal">)</code></span>”</span>
does not correspond to any
<span class="quote">“<span class="quote"><code class="literal">(</code></span>”</span>. In contrast,
<span class="quote">“<span class="quote"><code class="literal"><code class="literal"><a class="link" href="ch02s04s05.html#searchDescription">?description</a></code>(etc~))</code></span>”</span>
matches any package whose description contains the text
<span class="quote">“<span class="quote"><code class="literal">etc)</code></span>”</span>. There are
additional considerations if you are using the shorthand
notation for a term; see <a class="xref" href="ch02s04s02.html" title="Shorthand for search terms">the section called “Shorthand for search terms”</a> for details.
</p><p>
Most textual searches (for package names, descriptions, etc)
are performed using case-insensitive <a class="ulink" href="http://web.archive.org/web/20060719181658/http://sitescooper.org/tao_regexps.html" target="_top">regular
expressions</a>. A regular expression will match
against a field if any portion of the field matches the
expression; for instance,
<span class="quote">“<span class="quote"><code class="literal">ogg[0-9]</code></span>”</span> will match
<span class="quote">“<span class="quote"><code class="literal">libogg5</code></span>”</span>,
<span class="quote">“<span class="quote"><code class="literal">ogg123</code></span>”</span>, and
<span class="quote">“<span class="quote"><code class="literal">theogg4u</code></span>”</span>.
Some characters have a special meaning within regular
expressions
<a href="#ftn.idm2628" class="footnote" id="idm2628"><sup class="footnote">[15]</sup></a>
, so if you want to match them in searches you need to
backslash-escape them: for instance, to find
<span class="quote">“<span class="quote"><code class="literal">g++</code></span>”</span>, you should use the
pattern <span class="quote">“<span class="quote"><code class="literal">g\+\+</code></span>”</span>.
</p><p>
The characters <span class="quote">“<span class="quote"><code class="literal">!</code></span>”</span> and
<span class="quote">“<span class="quote"><code class="literal">|</code></span>”</span> have special meanings
within search patterns. In order to include these
characters in an unquoted string, you can place a tilde
(<span class="quote">“<span class="quote"><code class="literal">~</code></span>”</span>) directly before them.
For instance, to match packages whose description contains
either <span class="quote">“<span class="quote">grand</span>”</span> or <span class="quote">“<span class="quote">oblique</span>”</span>, use
the pattern
<span class="quote">“<span class="quote"><code class="literal"><code class="literal"><a class="link" href="ch02s04s05.html#searchDescription">?description</a></code>(grand~|oblique)</code></span>”</span>.
However, you will probably find it more convenient to simply
use a quoted string in these cases:
<span class="quote">“<span class="quote"><code class="literal"><code class="literal"><a class="link" href="ch02s04s05.html#searchDescription">?description</a></code>("grand|oblique")</code></span>”</span>.
</p><div class="footnotes"><br /><hr style="width:100; text-align:left;margin-left: 0" /><div id="ftn.idm2586" class="footnote"><p><a href="#idm2586" class="para"><sup class="para">[14] </sup></a>
<span class="command"><strong>aptitude</strong></span> will only treat the comma as special if there
is a second argument, so (for instance)
<span class="quote">“<span class="quote"><code class="literal"><code class="literal"><a class="link" href="ch02s04s05.html#searchTermName">?name</a></code>(apt,itude)</code></span>”</span>
searches for the string
<span class="quote">“<span class="quote"><code class="literal">apt,itude</code></span>”</span> in the
<code class="literal">Name</code> field of packages.
</p><p>
While this behavior is well-defined, it may be
surprising; I recommend using quoted strings for any
pattern that contains characters that could have a
special meaning.
</p></div><div id="ftn.idm2628" class="footnote"><p><a href="#idm2628" class="para"><sup class="para">[15] </sup></a>
Characters with a special meaning include:
<span class="quote">“<span class="quote"><code class="literal">+</code></span>”</span>,
<span class="quote">“<span class="quote"><code class="literal">-</code></span>”</span>,
<span class="quote">“<span class="quote"><code class="literal">.</code></span>”</span>,
<span class="quote">“<span class="quote"><code class="literal">(</code></span>”</span>,
<span class="quote">“<span class="quote"><code class="literal">)</code></span>”</span>,
<span class="quote">“<span class="quote"><code class="literal">|</code></span>”</span>,
<span class="quote">“<span class="quote"><code class="literal">[</code></span>”</span>,
<span class="quote">“<span class="quote"><code class="literal">]</code></span>”</span>,
<span class="quote">“<span class="quote"><code class="literal">^</code></span>”</span>,
<span class="quote">“<span class="quote"><code class="literal">$</code></span>”</span>, and
<span class="quote">“<span class="quote"><code class="literal">?</code></span>”</span>. Note that some of
these are also <span class="command"><strong>aptitude</strong></span> metacharacters, so if you want
to type (for instance) a literal
<span class="quote">“<span class="quote"><code class="literal">|</code></span>”</span>, it must be
double-escaped:
<span class="quote">“<span class="quote"><code class="literal"><code class="literal"><a class="link" href="ch02s04s05.html#searchDescription">?description</a></code>(\~|)</code></span>”</span>
will match packages whose description contains a
vertical bar character
(<span class="quote">“<span class="quote"><code class="literal">|</code></span>”</span>).
</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s04.html"><img src="images/prev.gif" alt="Prev" /></a> </td><td width="20%" align="center"><a accesskey="u" href="ch02s04.html"><img src="images/up.gif" alt="Up" /></a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s04s02.html"><img src="images/next.gif" alt="Next" /></a></td></tr><tr><td width="40%" align="left" valign="top">Search patterns </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.gif" alt="Home" /></a></td><td width="40%" align="right" valign="top"> Shorthand for search terms</td></tr></table></div></body></html>
|