diff options
| author | Richard M. Stallman | 2003-02-26 09:55:45 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-02-26 09:55:45 +0000 |
| commit | f31431028fbeef4d4ebc3620b0498aa3856514b6 (patch) | |
| tree | 2cf31a9005cdee6632b3bdaf46be61d05a4fcb59 | |
| parent | 6a080ff1ea639fc1f863498a3b33fb8ab384aa9b (diff) | |
| download | emacs-f31431028fbeef4d4ebc3620b0498aa3856514b6.tar.gz emacs-f31431028fbeef4d4ebc3620b0498aa3856514b6.zip | |
(Regexps): Convert the main table into @table @asis.
| -rw-r--r-- | man/search.texi | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/man/search.texi b/man/search.texi index a9d5b5e9ba5..44b14ae008d 100644 --- a/man/search.texi +++ b/man/search.texi | |||
| @@ -413,14 +413,14 @@ and @samp{o} to get the regular expression @samp{fo}, which matches only | |||
| 413 | the string @samp{fo}. Still trivial. To do something nontrivial, you | 413 | the string @samp{fo}. Still trivial. To do something nontrivial, you |
| 414 | need to use one of the special characters. Here is a list of them. | 414 | need to use one of the special characters. Here is a list of them. |
| 415 | 415 | ||
| 416 | @table @kbd | 416 | @table @asis |
| 417 | @item .@: @r{(Period)} | 417 | @item @kbd{.}@: @r{(Period)} |
| 418 | is a special character that matches any single character except a newline. | 418 | is a special character that matches any single character except a newline. |
| 419 | Using concatenation, we can make regular expressions like @samp{a.b}, which | 419 | Using concatenation, we can make regular expressions like @samp{a.b}, which |
| 420 | matches any three-character string that begins with @samp{a} and ends with | 420 | matches any three-character string that begins with @samp{a} and ends with |
| 421 | @samp{b}.@refill | 421 | @samp{b}.@refill |
| 422 | 422 | ||
| 423 | @item * | 423 | @item @kbd{*} |
| 424 | is not a construct by itself; it is a postfix operator that means to | 424 | is not a construct by itself; it is a postfix operator that means to |
| 425 | match the preceding regular expression repetitively as many times as | 425 | match the preceding regular expression repetitively as many times as |
| 426 | possible. Thus, @samp{o*} matches any number of @samp{o}s (including no | 426 | possible. Thus, @samp{o*} matches any number of @samp{o}s (including no |
| @@ -441,18 +441,18 @@ tries to match all three @samp{a}s; but the rest of the pattern is | |||
| 441 | The next alternative is for @samp{a*} to match only two @samp{a}s. | 441 | The next alternative is for @samp{a*} to match only two @samp{a}s. |
| 442 | With this choice, the rest of the regexp matches successfully.@refill | 442 | With this choice, the rest of the regexp matches successfully.@refill |
| 443 | 443 | ||
| 444 | @item + | 444 | @item @kbd{+} |
| 445 | is a postfix operator, similar to @samp{*} except that it must match | 445 | is a postfix operator, similar to @samp{*} except that it must match |
| 446 | the preceding expression at least once. So, for example, @samp{ca+r} | 446 | the preceding expression at least once. So, for example, @samp{ca+r} |
| 447 | matches the strings @samp{car} and @samp{caaaar} but not the string | 447 | matches the strings @samp{car} and @samp{caaaar} but not the string |
| 448 | @samp{cr}, whereas @samp{ca*r} matches all three strings. | 448 | @samp{cr}, whereas @samp{ca*r} matches all three strings. |
| 449 | 449 | ||
| 450 | @item ? | 450 | @item @kbd{?} |
| 451 | is a postfix operator, similar to @samp{*} except that it can match the | 451 | is a postfix operator, similar to @samp{*} except that it can match the |
| 452 | preceding expression either once or not at all. For example, | 452 | preceding expression either once or not at all. For example, |
| 453 | @samp{ca?r} matches @samp{car} or @samp{cr}; nothing else. | 453 | @samp{ca?r} matches @samp{car} or @samp{cr}; nothing else. |
| 454 | 454 | ||
| 455 | @item *?, +?, ?? | 455 | @item @kbd{*?}, @kbd{+?}, @kbd{??} |
| 456 | @cindex non-greedy regexp matching | 456 | @cindex non-greedy regexp matching |
| 457 | are non-greedy variants of the operators above. The normal operators | 457 | are non-greedy variants of the operators above. The normal operators |
| 458 | @samp{*}, @samp{+}, @samp{?} are @dfn{greedy} in that they match as | 458 | @samp{*}, @samp{+}, @samp{?} are @dfn{greedy} in that they match as |
| @@ -473,13 +473,13 @@ you search for @samp{a.*?$} against the text @samp{abbab} followed by | |||
| 473 | a newline, it matches the whole string. Since it @emph{can} match | 473 | a newline, it matches the whole string. Since it @emph{can} match |
| 474 | starting at the first @samp{a}, it does. | 474 | starting at the first @samp{a}, it does. |
| 475 | 475 | ||
| 476 | @item \@{@var{n}\@} | 476 | @item @kbd{\@{@var{n}\@}} |
| 477 | is a postfix operator that specifies repetition @var{n} times---that | 477 | is a postfix operator that specifies repetition @var{n} times---that |
| 478 | is, the preceding regular expression must match exactly @var{n} times | 478 | is, the preceding regular expression must match exactly @var{n} times |
| 479 | in a row. For example, @samp{x\@{4\@}} matches the string @samp{xxxx} | 479 | in a row. For example, @samp{x\@{4\@}} matches the string @samp{xxxx} |
| 480 | and nothing else. | 480 | and nothing else. |
| 481 | 481 | ||
| 482 | @item \@{@var{n},@var{m}\@} | 482 | @item @kbd{\@{@var{n},@var{m}\@}} |
| 483 | is a postfix operator that specifies repetition between @var{n} and | 483 | is a postfix operator that specifies repetition between @var{n} and |
| 484 | @var{m} times---that is, the preceding regular expression must match | 484 | @var{m} times---that is, the preceding regular expression must match |
| 485 | at least @var{n} times, but no more than @var{m} times. If @var{m} is | 485 | at least @var{n} times, but no more than @var{m} times. If @var{m} is |
| @@ -488,7 +488,7 @@ expression must match at least @var{n} times.@* @samp{\@{0,1\@}} is | |||
| 488 | equivalent to @samp{?}. @* @samp{\@{0,\@}} is equivalent to | 488 | equivalent to @samp{?}. @* @samp{\@{0,\@}} is equivalent to |
| 489 | @samp{*}. @* @samp{\@{1,\@}} is equivalent to @samp{+}. | 489 | @samp{*}. @* @samp{\@{1,\@}} is equivalent to @samp{+}. |
| 490 | 490 | ||
| 491 | @item [ @dots{} ] | 491 | @item @kbd{[ @dots{} ]} |
| 492 | is a @dfn{character set}, which begins with @samp{[} and is terminated | 492 | is a @dfn{character set}, which begins with @samp{[} and is terminated |
| 493 | by @samp{]}. In the simplest case, the characters between the two | 493 | by @samp{]}. In the simplest case, the characters between the two |
| 494 | brackets are what this set can match. | 494 | brackets are what this set can match. |
| @@ -523,7 +523,7 @@ ends of the range in upper case, or both in lower case, or both should | |||
| 523 | be non-letters. The behavior of a mixed-case range such as @samp{A-z} | 523 | be non-letters. The behavior of a mixed-case range such as @samp{A-z} |
| 524 | is somewhat ill-defined, and it may change in future Emacs versions. | 524 | is somewhat ill-defined, and it may change in future Emacs versions. |
| 525 | 525 | ||
| 526 | @item [^ @dots{} ] | 526 | @item @kbd{[^ @dots{} ]} |
| 527 | @samp{[^} begins a @dfn{complemented character set}, which matches any | 527 | @samp{[^} begins a @dfn{complemented character set}, which matches any |
| 528 | character except the ones specified. Thus, @samp{[^a-z0-9A-Z]} matches | 528 | character except the ones specified. Thus, @samp{[^a-z0-9A-Z]} matches |
| 529 | all characters @emph{except} ASCII letters and digits. | 529 | all characters @emph{except} ASCII letters and digits. |
| @@ -536,17 +536,17 @@ A complemented character set can match a newline, unless newline is | |||
| 536 | mentioned as one of the characters not to match. This is in contrast to | 536 | mentioned as one of the characters not to match. This is in contrast to |
| 537 | the handling of regexps in programs such as @code{grep}. | 537 | the handling of regexps in programs such as @code{grep}. |
| 538 | 538 | ||
| 539 | @item ^ | 539 | @item @kbd{^} |
| 540 | is a special character that matches the empty string, but only at the | 540 | is a special character that matches the empty string, but only at the |
| 541 | beginning of a line in the text being matched. Otherwise it fails to | 541 | beginning of a line in the text being matched. Otherwise it fails to |
| 542 | match anything. Thus, @samp{^foo} matches a @samp{foo} that occurs at | 542 | match anything. Thus, @samp{^foo} matches a @samp{foo} that occurs at |
| 543 | the beginning of a line. | 543 | the beginning of a line. |
| 544 | 544 | ||
| 545 | @item $ | 545 | @item @kbd{$} |
| 546 | is similar to @samp{^} but matches only at the end of a line. Thus, | 546 | is similar to @samp{^} but matches only at the end of a line. Thus, |
| 547 | @samp{x+$} matches a string of one @samp{x} or more at the end of a line. | 547 | @samp{x+$} matches a string of one @samp{x} or more at the end of a line. |
| 548 | 548 | ||
| 549 | @item \ | 549 | @item @kbd{\} |
| 550 | has two functions: it quotes the special characters (including | 550 | has two functions: it quotes the special characters (including |
| 551 | @samp{\}), and it introduces additional special constructs. | 551 | @samp{\}), and it introduces additional special constructs. |
| 552 | 552 | ||