⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search_help.html

📁 项目源码察看工具lxr-0.3.tar.gz
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD><TITLE>Linux Cross-Reference</TITLE></HEAD><BODY BGCOLOR=WHITE><H1 ALIGN=CENTER>Help doing searches<BR><A HREF="http:/source/"><I>Browse the code</I></A></H1><I> This text is directly stolen from the Glimpse manual page. I havetried to remove things that do not apply to the lxr searcher, butbeware, some things might have slipped through. I'll try to puttogether something better when I get the time. For more information onglimpse go to the <A HREF="http://glimpse.cs.arizona.edu">Glimpsehomepage</A>.</I><A NAME="Patterns"></A><H2>Patterns</H2><P>glimpse supports a large variety of patterns, including simplestrings, strings with classes of characters, sets of strings, wild cards, and regular expressions (see <A HREF="#Limitations">Limitations</A>).<P> <H3>Strings</H3>Strings are any sequence of characters, including the special symbols`^' for beginning of line and `$' for end of line.  The followingspecial characters (`$', `^', `*', `[', `^', `|', `(', `)', `!', and`\' ) as well as the following meta characters special to glimpse (andagrep): `;', `,', `#', `&gt;', `&lt;', `-', and `.', should be preceded by`\\' if they are to be matched as regular characters.  For example,\\^abc\\\\ corresponds to the string ^abc\\, whereas ^abc correspondsto the string abc at the beginning of a line.<P> <H3>Classes of characters</H3>a list of characters inside [] (in order) corresponds to any characterfrom the list.  For example, [a-ho-z] is any character between a and hor between o and z.  The symbol `^' inside [] complements the list.For example, [^i-n] denote any character in the character set exceptcharacter 'i' to 'n'.The symbol `^' thus has two meanings, but this is consistent withegrep.The symbol `.' (don't care) stands for any symbol (except for thenewline symbol).<P> <H3>Boolean operations</H3>Glimpse supports an `AND' operation denoted by the symbol `;' an `OR' operation denoted by the symbol `,',a limited version of a 'NOT' operation (starting at version 4.0B1)denoted by the symbol `~',or any combination.  For example, pizza;cheeseburger' will output all lines containingboth patterns.'{political,computer};science' will match 'political science' or 'science of computers'.<P><H3>Wild cards</H3>The symbol '#' is used to denote a sequence of any number (including 0) of arbitrary characters (see <A HREF="#Limitations">Limitations</A>).  The symbol # is equivalent to .* in egrep.In fact, .* will work too, because it is a valid regular expression(see below), but unless this is part of an actual regular expression,# will work faster. (Currently glimpse is experiencing some problems with #.)<P><H3>Combination of exact and approximate matching</H3>Any pattern inside angle brackets &lt;&gt; must match the text exactly evenif the match is with errors.  For example, &lt;mathemat&gt;ics matchesmathematical with one error (replacing the last s with an a), butmathe&lt;matics&gt; does not match mathematical no matter how many errors areallowed. (This option is buggy at the moment.)<H3>Regular expressions</H3>Since the index is word based, a regular expression must match wordsthat appear in the index for glimpse to find it.  Glimpse first stripsthe regular expression from all non-alphabetic characters, andsearches the index for all remaining words.  It then applies theregular expression matching algorithm to the files found in the index.For example, glimpse 'abc.*xyz' will search the index for all filesthat contain both 'abc' and 'xyz', and then search directly for'abc.*xyz' in those files.  (If you use glimpse -w 'abc.*xyz', then'abcxyz' will not be found, because glimpse will think that abc andxyz need to be matches to whole words.)  The syntax of regularexpressions in glimpse is in general the same as that for agrep.  Theunion operation `|', Kleene closure `*', and parentheses () are allsupported.  Currently '+' is not supported.  Regular expressions arecurrently limited to approximately 30 characters (generally excludingmeta characters). The maximal number of errorsfor regular expressions that use '*' or '|' is 4.<P><A NAME="Limitations"></A><H2>Limitations</H2>The index of glimpse is word based.  A pattern that contains more thanone word cannot be found in the index.  The way glimpse overcomes thisweakness is by splitting any multi-word pattern into its set of wordsand looking for all of them in the index.For example, <I>'linear programming'</I> will first consult the indexto find all files containing both <I>linear</I> and <I>programming</I>,and then apply agrep to find the combined pattern.This is usually an effective solution, but it can be slow forcases where both words are very common, but their combination is not.<P>As was mentioned in the section on <A HREF="#Patterns">Patterns</A> above, some charactersserve as meta characters for glimpse and need to bepreceded by '\\' to search for them.  The most commonexamples are the characters '.' (which stands for a wild card),and '*' (the Kleene closure).So, "glimpse ab.de" will match abcde, but "glimpse ab\\.de"will not, and "glimpse ab*de" will not match ab*de, but "glimpse ab\\*de" will.The meta character - is translated automatically to a hypenunless it appears between [] (in which case it denotes a range ofcharacters).<P>There is no size limit for simple patterns and simple patternswithin Boolean expressions.More complicated patterns, such as regular expressions,are currently limited to approximately 30 characters.Lines are limited to 1024 characters.<P><HR><ADDRESS>  <A HREF="mailto:lxr@linux.no">    Arne Georg Gleditsch and Per Kristian Gjermshus</A></ADDRESS></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -