Reputation: 31
Suppose I have a file named as test.txt having content . I want to find the line containing the words starting with "r" character and ending with "i" character?
Upvotes: 0
Views: 219
Reputation: 881103
That would be something like:
grep '\b[Rr][A-Za-z]*[Ii]\b' test.txt
That's case insensitive so, if you want to ensure specific capitalisation, you would adjust the individual character classes in the expression.
Upvotes: 1