I have the following example lines:
a_a b_c
How (using grep/egrep) would I match the lines where the first letter
grep
egrep
Use a negative look behind anchored to end of input. A general regex for "first char is not last char" is:
^(.).*(?
To match only your type of input:
^(.)_.(?