[5012] | 1 | ... |
---|
[15699] | 2 | ... $Id: dsgrep.1,v 1.5 2001-02-28 20:43:54 ghudson Exp $ |
---|
[5012] | 3 | ... |
---|
[5479] | 4 | .TH DSGREP 1 "18 Jun 1990" |
---|
| 5 | .ds ]W MIT Project Athena |
---|
[5012] | 6 | .SH NAME |
---|
| 7 | dsgrep \- Search discuss meetings with regular expressions |
---|
| 8 | .SH SYNOPSIS |
---|
| 9 | dsgrep [-n n_trans] [-e search_regexp] [-f meetings_file] |
---|
| 10 | [-t trans_num] [-a] [-p] [-v] [-i] [meetingname1 meetingname2 ...] |
---|
| 11 | .SH DESCRIPTION |
---|
| 12 | .I Dsgrep |
---|
| 13 | searches discuss meetings for transactions that have titles that match the |
---|
| 14 | given regular expression, or have contents that match the regular |
---|
| 15 | expression. The title of the matching transactions or their contents |
---|
| 16 | can be printed. |
---|
| 17 | |
---|
| 18 | .I Dsgrep |
---|
| 19 | understands the following options: |
---|
| 20 | .TP 12 |
---|
| 21 | .B \-n \fIn_trans\fR |
---|
| 22 | specifies the number of transactions to look back from the last transaction |
---|
| 23 | in each discuss meeting specified. This defaults to 50. This option is |
---|
| 24 | ignored when the -t option is specified. |
---|
| 25 | .TP |
---|
| 26 | .B \-e \fIsearch_regexp\fR |
---|
| 27 | This specifies the regular expression to be matched, in the style of |
---|
| 28 | .IR egrep (1). |
---|
| 29 | A detailed explaination of the regular expression format is |
---|
| 30 | given below. If this is omitted, it defaults to "*", matching all |
---|
| 31 | transactions. |
---|
| 32 | .TP |
---|
| 33 | .B \-f \fImeetings_file\fR |
---|
| 34 | This specifies an alternative meetings file to use as a source of meetings. |
---|
[5311] | 35 | If this option is not specified, it will use the file ${HOME}/.meetings., |
---|
[5012] | 36 | .TP |
---|
| 37 | .B \-t \fItrans_num\fR |
---|
| 38 | Print out a specific transaction, by number. When this option is used, the |
---|
| 39 | -n option is ignored. |
---|
| 40 | .TP |
---|
| 41 | .B \-a |
---|
| 42 | Causes |
---|
| 43 | .I dsgrep |
---|
| 44 | to search the text of the transactions for the regular expressions as well |
---|
| 45 | as their titles. |
---|
| 46 | .TP |
---|
| 47 | .B \-p |
---|
| 48 | Causes the text of the text of the matching transactions to be printed |
---|
| 49 | instead of just the title. |
---|
| 50 | .TP |
---|
| 51 | .B \-v |
---|
| 52 | Causes errors getting transactions to be reported. These errors are usually |
---|
| 53 | due to deleted transactions in the meetings, and are ususally not worth |
---|
| 54 | seeing. |
---|
| 55 | .TP |
---|
| 56 | .B \-d |
---|
| 57 | Causes deleted transactions to be searched as well. Otherwise, deleted |
---|
| 58 | transactions are ignored. |
---|
| 59 | .TP |
---|
| 60 | .B \-i |
---|
[15699] | 61 | Ignores case when matching against \fIsearch_regexp\fR. |
---|
[5012] | 62 | .TP |
---|
| 63 | .B \fImeetings\fR |
---|
| 64 | This specifies the meetings to search; if it is left off, |
---|
| 65 | .I dsgrep |
---|
| 66 | will search all the meetings. |
---|
| 67 | .SH "REGULAR EXPRESSION SYNTAX" |
---|
| 68 | A regular expression is zero or more \fIbranches\fR, separated by `|'. |
---|
| 69 | It matches anything that matches one of the branches. |
---|
| 70 | .PP |
---|
| 71 | A branch is zero or more \fIpieces\fR, concatenated. |
---|
| 72 | It matches a match for the first, followed by a match for the second, etc. |
---|
| 73 | .PP |
---|
| 74 | A piece is an \fIatom\fR possibly followed by `*', `+', or `?'. |
---|
| 75 | An atom followed by `*' matches a sequence of 0 or more matches of the atom. |
---|
| 76 | An atom followed by `+' matches a sequence of 1 or more matches of the atom. |
---|
| 77 | An atom followed by `?' matches a match of the atom, or the null string. |
---|
| 78 | .PP |
---|
| 79 | An atom is a regular expression in parentheses (matching a match for the |
---|
| 80 | regular expression), a \fIrange\fR (see below), `.' |
---|
| 81 | (matching any single character), `^' (matching the null string at the |
---|
| 82 | beginning of the input string), `$' (matching the null string at the |
---|
| 83 | end of the input string), a `\e' followed by a single character (matching |
---|
| 84 | that character), or a single character with no other significance |
---|
| 85 | (matching that character). |
---|
| 86 | .PP |
---|
| 87 | A \fIrange\fR is a sequence of characters enclosed in `[]'. |
---|
| 88 | It normally matches any single character from the sequence. |
---|
| 89 | If the sequence begins with `^', |
---|
| 90 | it matches any single character \fInot\fR from the rest of the sequence. |
---|
| 91 | If two characters in the sequence are separated by `\-', this is shorthand |
---|
| 92 | for the full list of ASCII characters between them |
---|
| 93 | (e.g. `[0-9]' matches any decimal digit). |
---|
| 94 | To include a literal `]' in the sequence, make it the first character |
---|
| 95 | (following a possible `^'). |
---|
| 96 | To include a literal `\-', make it the first or last character. |
---|
| 97 | .SH AMBIGUITY |
---|
| 98 | If a regular expression could match two different parts of the input string, |
---|
| 99 | it will match the one which begins earliest. |
---|
| 100 | If both begin in the same place but match different lengths, or match |
---|
| 101 | the same length in different ways, life gets messier, as follows. |
---|
| 102 | .PP |
---|
| 103 | In general, the possibilities in a list of branches are considered in |
---|
| 104 | left-to-right order, the possibilities for `*', `+', and `?' are |
---|
| 105 | considered longest-first, nested constructs are considered from the |
---|
| 106 | outermost in, and concatenated constructs are considered leftmost-first. |
---|
| 107 | The match that will be chosen is the one that uses the earliest |
---|
| 108 | possibility in the first choice that has to be made. |
---|
| 109 | If there is more than one choice, the next will be made in the same manner |
---|
| 110 | (earliest possibility) subject to the decision on the first choice. |
---|
| 111 | And so forth. |
---|
| 112 | .PP |
---|
| 113 | For example, `(ab|a)b*c' could match `abc' in one of two ways. |
---|
| 114 | The first choice is between `ab' and `a'; since `ab' is earlier, and does |
---|
| 115 | lead to a successful overall match, it is chosen. |
---|
| 116 | Since the `b' is already spoken for, |
---|
| 117 | the `b*' must match its last possibility\(emthe empty string\(emsince |
---|
| 118 | it must respect the earlier choice. |
---|
| 119 | .PP |
---|
| 120 | In the particular case where no `|'s are present and there is only one |
---|
| 121 | `*', `+', or `?', the net effect is that the longest possible |
---|
| 122 | match will be chosen. |
---|
| 123 | So `ab*', presented with `xabbbby', will match `abbbb'. |
---|
| 124 | Note that if `ab*' is tried against `xabyabbbz', it |
---|
| 125 | will match `ab' just after `x', due to the begins-earliest rule. |
---|
| 126 | (In effect, the decision on where to start the match is the first choice |
---|
| 127 | to be made, hence subsequent choices must respect it even if this leads them |
---|
| 128 | to less-preferred alternatives.) |
---|
| 129 | |
---|
| 130 | .SH SEE ALSO |
---|
| 131 | .PP |
---|
| 132 | egrep(1), discuss(1) |
---|