ICT: Diary
D: 28 W: 05
| < | January 2022 | > | ||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 31 | |||||
[ < ]
Tuesday, 18 January 2022 [ >
]
grep
Using grep to find words of a specific length, can be done in a number of ways.
grep -E '^[[:alpha:]]{4}$' file
grep -E '^[A-Za-z]{4}$' file
grep -E '^.{4}$' file
grep -E '^....$' file
grep '^....$' file
grep '^.\{4\}$' file
The examples above all give the same results. Using -E option makes the pattern be interpreted as an extended regular expression, thus grep behaves as egrep. It the last example the braces need to be escaped otherwise it would be a literal match on .{4}
echo '.{4}' | grep '^.{4}$'
.{4}
The dictionary files can be found /usr/share/dict/
$Id: dates.htm,v 1
$Id: diary,v 1.38 2025/01/01 22:43:54 fred Exp $