Mercurial > emacs
changeset 49984:632746dc04e4
(Regexps): Convert the main table into @table @asis.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 26 Feb 2003 09:55:45 +0000 |
parents | 2a8850f484eb |
children | 5bb62138f451 |
files | man/search.texi |
diffstat | 1 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/man/search.texi Wed Feb 26 09:54:36 2003 +0000 +++ b/man/search.texi Wed Feb 26 09:55:45 2003 +0000 @@ -413,14 +413,14 @@ the string @samp{fo}. Still trivial. To do something nontrivial, you need to use one of the special characters. Here is a list of them. -@table @kbd -@item .@: @r{(Period)} +@table @asis +@item @kbd{.}@: @r{(Period)} is a special character that matches any single character except a newline. Using concatenation, we can make regular expressions like @samp{a.b}, which matches any three-character string that begins with @samp{a} and ends with @samp{b}.@refill -@item * +@item @kbd{*} is not a construct by itself; it is a postfix operator that means to match the preceding regular expression repetitively as many times as possible. Thus, @samp{o*} matches any number of @samp{o}s (including no @@ -441,18 +441,18 @@ The next alternative is for @samp{a*} to match only two @samp{a}s. With this choice, the rest of the regexp matches successfully.@refill -@item + +@item @kbd{+} is a postfix operator, similar to @samp{*} except that it must match the preceding expression at least once. So, for example, @samp{ca+r} matches the strings @samp{car} and @samp{caaaar} but not the string @samp{cr}, whereas @samp{ca*r} matches all three strings. -@item ? +@item @kbd{?} is a postfix operator, similar to @samp{*} except that it can match the preceding expression either once or not at all. For example, @samp{ca?r} matches @samp{car} or @samp{cr}; nothing else. -@item *?, +?, ?? +@item @kbd{*?}, @kbd{+?}, @kbd{??} @cindex non-greedy regexp matching are non-greedy variants of the operators above. The normal operators @samp{*}, @samp{+}, @samp{?} are @dfn{greedy} in that they match as @@ -473,13 +473,13 @@ a newline, it matches the whole string. Since it @emph{can} match starting at the first @samp{a}, it does. -@item \@{@var{n}\@} +@item @kbd{\@{@var{n}\@}} is a postfix operator that specifies repetition @var{n} times---that is, the preceding regular expression must match exactly @var{n} times in a row. For example, @samp{x\@{4\@}} matches the string @samp{xxxx} and nothing else. -@item \@{@var{n},@var{m}\@} +@item @kbd{\@{@var{n},@var{m}\@}} is a postfix operator that specifies repetition between @var{n} and @var{m} times---that is, the preceding regular expression must match at least @var{n} times, but no more than @var{m} times. If @var{m} is @@ -488,7 +488,7 @@ equivalent to @samp{?}. @* @samp{\@{0,\@}} is equivalent to @samp{*}. @* @samp{\@{1,\@}} is equivalent to @samp{+}. -@item [ @dots{} ] +@item @kbd{[ @dots{} ]} is a @dfn{character set}, which begins with @samp{[} and is terminated by @samp{]}. In the simplest case, the characters between the two brackets are what this set can match. @@ -523,7 +523,7 @@ be non-letters. The behavior of a mixed-case range such as @samp{A-z} is somewhat ill-defined, and it may change in future Emacs versions. -@item [^ @dots{} ] +@item @kbd{[^ @dots{} ]} @samp{[^} begins a @dfn{complemented character set}, which matches any character except the ones specified. Thus, @samp{[^a-z0-9A-Z]} matches all characters @emph{except} ASCII letters and digits. @@ -536,17 +536,17 @@ mentioned as one of the characters not to match. This is in contrast to the handling of regexps in programs such as @code{grep}. -@item ^ +@item @kbd{^} is a special character that matches the empty string, but only at the beginning of a line in the text being matched. Otherwise it fails to match anything. Thus, @samp{^foo} matches a @samp{foo} that occurs at the beginning of a line. -@item $ +@item @kbd{$} is similar to @samp{^} but matches only at the end of a line. Thus, @samp{x+$} matches a string of one @samp{x} or more at the end of a line. -@item \ +@item @kbd{\} has two functions: it quotes the special characters (including @samp{\}), and it introduces additional special constructs.