I've got a bunch of files that have sentences ending like this: \@.Next sentence
. I'd like to insert a space after the period.
Not all occurrences of \@.
do not have a space, however, so my regex checks if the next character after the period is a capital letter.
Because I'm checking one character after the period, I can't just do a replace on \@.
to \@.
, and because I don't know what character is following the period, I'm stuck.
My command currently:
sed -i .bak -E 's/\\@\.[A-Z]/<SOMETHING IN HERE>/g' *.tex
How can I grab the last letter of the matching string to use in the replacement regex?
EDIT: For the record, I'm using a BSD version of sed
(I'm using OS X) - from my previous question regarding sed
, apparently BSD sed (or at least, the Apple version) doesn't always play nice with GNU sed regular expressions.