Daniel James Smith
Daniel James Smith

Reputation: 65

GREP to find capital T not preceded by a full stop and a space in InDesign

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

Answers (1)

Sundeep
Sundeep

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

Related Questions