I am trying to use grep to capture data below:
"\\.xy$" "\\.ab$" "\\.ef\\.hi$"
I have
grep -Eo "((\\\\\.[a-zA-Z]+)){1,2}\\$" file
two problems:
- It can capture things like \\.xy$, but not \\.xy\\.ef$
- the returned results have literal $ at the end, why?