Reputation: 65
I have a document that has lots of capital letter Ts (The A&E Department, The Post Office). I want to find all instances of a capital T when not preceded by a full point and a space so I can change the capital T to a small t.
I tried:
(?<!.~.)[T]
and
(?<!.~.)T
which I thought should find all Ts not preceded by a full point and a space. However, both find all capital Ts, the negative lookbehind seems to be ignored.
I'm fairly new to GREP and I've spent a few hours Googling and tried lots of different variations but these seem to me that they should work?
Thanks in advance.
Upvotes: 1
Views: 229
Reputation: 23697
(?<!\. )T
which will match T
only if not preceded by a .
and a space character sequence.
.
is a metacharacter, so it has to be escaped for matching it literally
Upvotes: 1