1 | ... |
---|
2 | ... $Id: dsgrep.1,v 1.4 1999-01-22 23:09:38 ghudson Exp $ |
---|
3 | ... |
---|
4 | .TH DSGREP 1 "18 Jun 1990" |
---|
5 | .ds ]W MIT Project Athena |
---|
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. |
---|
35 | If this option is not specified, it will use the file ${HOME}/.meetings., |
---|
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 |
---|
61 | Converts the text of the titles/transactions to be converted to lower case |
---|
62 | before it is searched. This allows for case-insensitive searching. |
---|
63 | .TP |
---|
64 | .B \fImeetings\fR |
---|
65 | This specifies the meetings to search; if it is left off, |
---|
66 | .I dsgrep |
---|
67 | will search all the meetings. |
---|
68 | .SH "REGULAR EXPRESSION SYNTAX" |
---|
69 | A regular expression is zero or more \fIbranches\fR, separated by `|'. |
---|
70 | It matches anything that matches one of the branches. |
---|
71 | .PP |
---|
72 | A branch is zero or more \fIpieces\fR, concatenated. |
---|
73 | It matches a match for the first, followed by a match for the second, etc. |
---|
74 | .PP |
---|
75 | A piece is an \fIatom\fR possibly followed by `*', `+', or `?'. |
---|
76 | An atom followed by `*' matches a sequence of 0 or more matches of the atom. |
---|
77 | An atom followed by `+' matches a sequence of 1 or more matches of the atom. |
---|
78 | An atom followed by `?' matches a match of the atom, or the null string. |
---|
79 | .PP |
---|
80 | An atom is a regular expression in parentheses (matching a match for the |
---|
81 | regular expression), a \fIrange\fR (see below), `.' |
---|
82 | (matching any single character), `^' (matching the null string at the |
---|
83 | beginning of the input string), `$' (matching the null string at the |
---|
84 | end of the input string), a `\e' followed by a single character (matching |
---|
85 | that character), or a single character with no other significance |
---|
86 | (matching that character). |
---|
87 | .PP |
---|
88 | A \fIrange\fR is a sequence of characters enclosed in `[]'. |
---|
89 | It normally matches any single character from the sequence. |
---|
90 | If the sequence begins with `^', |
---|
91 | it matches any single character \fInot\fR from the rest of the sequence. |
---|
92 | If two characters in the sequence are separated by `\-', this is shorthand |
---|
93 | for the full list of ASCII characters between them |
---|
94 | (e.g. `[0-9]' matches any decimal digit). |
---|
95 | To include a literal `]' in the sequence, make it the first character |
---|
96 | (following a possible `^'). |
---|
97 | To include a literal `\-', make it the first or last character. |
---|
98 | .SH AMBIGUITY |
---|
99 | If a regular expression could match two different parts of the input string, |
---|
100 | it will match the one which begins earliest. |
---|
101 | If both begin in the same place but match different lengths, or match |
---|
102 | the same length in different ways, life gets messier, as follows. |
---|
103 | .PP |
---|
104 | In general, the possibilities in a list of branches are considered in |
---|
105 | left-to-right order, the possibilities for `*', `+', and `?' are |
---|
106 | considered longest-first, nested constructs are considered from the |
---|
107 | outermost in, and concatenated constructs are considered leftmost-first. |
---|
108 | The match that will be chosen is the one that uses the earliest |
---|
109 | possibility in the first choice that has to be made. |
---|
110 | If there is more than one choice, the next will be made in the same manner |
---|
111 | (earliest possibility) subject to the decision on the first choice. |
---|
112 | And so forth. |
---|
113 | .PP |
---|
114 | For example, `(ab|a)b*c' could match `abc' in one of two ways. |
---|
115 | The first choice is between `ab' and `a'; since `ab' is earlier, and does |
---|
116 | lead to a successful overall match, it is chosen. |
---|
117 | Since the `b' is already spoken for, |
---|
118 | the `b*' must match its last possibility\(emthe empty string\(emsince |
---|
119 | it must respect the earlier choice. |
---|
120 | .PP |
---|
121 | In the particular case where no `|'s are present and there is only one |
---|
122 | `*', `+', or `?', the net effect is that the longest possible |
---|
123 | match will be chosen. |
---|
124 | So `ab*', presented with `xabbbby', will match `abbbb'. |
---|
125 | Note that if `ab*' is tried against `xabyabbbz', it |
---|
126 | will match `ab' just after `x', due to the begins-earliest rule. |
---|
127 | (In effect, the decision on where to start the match is the first choice |
---|
128 | to be made, hence subsequent choices must respect it even if this leads them |
---|
129 | to less-preferred alternatives.) |
---|
130 | |
---|
131 | .SH SEE ALSO |
---|
132 | .PP |
---|
133 | egrep(1), discuss(1) |
---|