I'm trying to find the set of words (if any) that contain two consecutive e’s, and also contains two y’s. But so far I tried following commands ,
grep -e '[y&y].*[ee]' -e '[y&y].*[ee]' words2.txt
grep -e 'y.y' -e 'ee' words2.txt
grep -X '.*[y.y].*&.*[ee].*' words2.txt
grep -X '.[*y.y].*&.[*ee].*' words2.txt
some of these commands gives either two y's or two consecutive e's, but don't give a word that contains both of these conditions. What should I do now?
grep
support PCRE?-X
option? or is it type for-x
? also, you need to add some sample input and output, it will show whether there are only single words in a line or multiple among other uses...grep
has a-X
option for augmented regexps that does support a&
conjunction operator.augmented regexps
before... will look it up :)