Skip to main content
1 of 2
user avatar
user avatar

Grep ^ and $ at the same time

I'm, trying to use grep with a ^ and $ at the same time but for some reason that does not work. If I type

grep '^s.*e' german.dic

I get a loist of wordst starting with s and having an e somewhere. A snippet from the output

szientistischer
szientistisches
szintigraphische
szintigraphischem
szintigraphischen
szintigraphischer
szintigraphisches

So there is a word 'szintigraphische', which has an e at the end of the line. What I would expect now is that if I typed

grep '^s.*e$' german.dic

that I would at least get that result. However, the resultset is empty. How should I write a correct regexp to find all words starting with an s and ending with an e ?

user50037