I was trying to identify lines who has a word of the following pattern "xyyx" (where x, and ys are different characters).
I was trying the following grep -
egrep '(\S)([^\1])\2\1'
This pattern do catches the wanted pattern, but it also catches "GGGG" or "CCCC" patterns. I was trying to check this on different regex infrastructure and it worked fine (catched only the wanted pattern).
Does anyone has an idea how to change the regex so it catches only the wanted pattern?
But the RegExp you wrote will accept strings of the form 'xxxx' and 'yyyy'.
I'm looking for a pattern that maches on 'xyyx' (Where x is different character then y).