April 2024 | ||||||
Mo | Tu | We | Th | Fr | Sa | Su |
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 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
You simply pass as the first command line argument the regular expression and
then the strings you want to try to match.
It is crucial, in order to avoid shell substitutions, to enclose both the
expression and the strings in single quotes.
The program then prints some information about the possibly successful
matching.
In the output the what[0] part represents the whole match, and the what[i]
part represents the i-th marked subexpression that matched.
The program also prints possible prefix and suffix.