Is there a simple way (without scripts) to add in a hypen to a variable query?
For example, If I have an address say:
221B Baker Street
I want to be able to place a hyphen to instead make it:
221-B Baker Street
But my other variable is a Suite number such as:
1107 Brooklyn Boulevard, Suite A350
but this should also be hyphenated to:
1107 Brooklyn Boulevard, Suite A-350
Here is my Find What:
But I want to be able to change to:
But this doesn't work because of the variability. Any help?
The following substitution i.e. "change to" term should work
See the demo here
However, when trying in InDesign it is placing $3 and $4 literally while substitution. In order to force it to recognize $3 and $4 we need to have some other character between $1 and $3 and likewise between $2 and $4. I used a hairline space, you could try with some other whitespace character. The following works for me
Is there no way to do this without the hairline space? My team does a lot of find/replaces, and I'd hate for their query to miss something because of a space added in
Using a single query I could not find any other way to make it work. As I showed in the demo, it works with other flavors of Regex implementation but InDesign's implementation does not work. I would await some grep geniuses on the forum to dish out a gem for this. For me, if the proposed solution does not fit the bill then it has to be done by using two separate queries.
Thank you for your help. I will see if anyone else has an answer. Thanks!
(^/) The Jedi
Omg, this is exactly what I needed! I had no idea what /K was, but I might have to start usisng it more!!
Ahh, brilliant. I did think of using \K but the piece that I was missing is $0