0

Should be simple but it's not.

This GREP expression works in the FIND/CHANGE PANEL in InDesign CC:

Working GREP function

However, when I plug it into a FindChangeList.txt, it doesn't work:

enter image description here

I know for a fact that the list file is being called correctly and works - so it's not anything to do with that. (If I change it to TEXT and change "2+2" to "2 + 2" the script runs perfectly.)

What is going on?

Thank you!

2
  • Hi LazarusBlack, welcome to GD.SE. Is there any reason why you can not use find \+ and replace with \s+\s?
    – user120647
    Commented Feb 3, 2019 at 20:45
  • 2
    Yes. Because I have multiple formats of the "+" plus in the text. Example: I need to convert every "2+2" to "2 + 2" while leaving "+2" as "+2" and "A+" as "A+" and "+/-" and "+/-". Commented Feb 3, 2019 at 21:34

2 Answers 2

2

My friends found the answer on this thread:

https://forums.adobe.com/thread/2207571

I needed to use double backslash in the text file.

So this works!

{findWhat:"(\\d)(\\+)(\\d)"}    
{changeTo:"$1\\s$2\\s$3"}   

Thanks to everyone who tired.

1

Try searching every \+ preceded by a number (?<=\d) and followed by a number (?=\d):

(?<=\d)\+(?=\d)

and change it for \s+\s

enter image description here

2
  • Nice try, but it behaves just like my script above. It works in the FIND/CHANGE panel but not in the FindChangeList.txt file. Commented Feb 3, 2019 at 21:48
  • To be clear, your script works just as you show - but only in the FIND/CHANGE panel you are showing me in the animation. Can you show me it working in the FindChangeList.txt file? Commented Feb 3, 2019 at 21:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.