I want to find a string of length 8 which starts with the characters "alo", in a text file.
For findstr, I have tried the following command - findstr /R "\<alo" file.txt
. This command searches for strings starting with "alo" but cannot search for strings of length 8. For grep, I don't know how to do it.
grep -woE 'alo.{5}' filename
-o is for printing only the match
-E is to use extended regex
-w will make the given expression match only whole words
The number inside the parenthesis specifies the number of character to match after the letters 'alo'