Copy link to clipboard
Copied
Hello, and thank you in advance for helping me if you can. I have a 700+ page document and I need to search out ^9-^9 and have it replace it with the digits found but change the - to –. Is that possible? I cannot request just the change from - to – because some of them need to remain as they need changing only in certain circumstances. There have often been times I need to search things like this (even with ^$) and have it use the wildcard feature to find but somehow request that it replace those wildcards with the same thing that was found. Obviously I am not an InDesign guru, so I apologize for that and any of the novice language I have used.. Any advice would be greatly appreciated.
Best Wishes,
Maggie
This is a job for GREP find and replace. (The code below finds a hyphen between two numbers and replaces just the hyphen with an n-dash.)
find
(?<=\d)-(?=\d)
replace with
~=

Copy link to clipboard
Copied
This is a job for GREP find and replace. (The code below finds a hyphen between two numbers and replaces just the hyphen with an n-dash.)
find
(?<=\d)-(?=\d)
replace with
~=

Copy link to clipboard
Copied
SJRiegel,
Oh My! THANK YOU SO MUCH! It is truly appreciated. That worked great, and it gave me the foundation so hopefully I can do some minor modifications on that idea for other applications.
Much appreciated,
Maggie
Copy link to clipboard
Copied
You're welcome, Maggie
GREP search and GREP styles are powerful tools - once you get to know them you will find all sorts of uses, and soon may be wondering what you ever did without them. ![]()
There are lots of online resources (including this forum) that can help you learn how to use them.
Copy link to clipboard
Copied
I REALLY NEED YOUR HELP!!! i need to search - find and replace a tab after a 5 digit zipcode to the same number with a hard return after
Example: 12345^t to 12345^p
There are lots of different zipcodes so the number will need to stay the same - i just want to replace the tab with a return..
Any guidance would be SOOOO HELPFUL....
Copy link to clipboard
Copied
Hi mclarkmd,
you do that with GREP Find/Change.
Look for a tab character \t that is preceded by a 5-digit number \d{5} that itself is fenced by a word begin and a word end \<\d{5}\>
Perfect for this kind of search is a positive look-behind like in this GREP pattern:
GREP Find:
(?<=\<\d{5}\>)\t
GREP Change:
\r
So you need not to replace a found piece of text with itself.
Regards,
Uwe Laubender
( Adobe Community Professional )
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more