Purely academic, but it's frustrating me.
I want to correct this text:
there there are are multiple lexical errors in this line line
using sed. I've got this far:
sed 's/\([a-z][a-z]*[ ,\n][ ,\n]*\)\1/\1/g' < file.text
It corrects everything except the final doubled up words!
there are multiple lexical errors in this line line
Can a sed guru please explain why the above doesn't deal with the words at the end?