elk Posted August 9, 2022 Posted August 9, 2022 How can I reference a search result to add it in the replace field? In other apps there is & used or $ but in AP it doesn’t work like this. What is the right way? Example GREP-Search: ^.+$ Replace: & plus new text ((where & is the result string)) Thanks for reading. ................................................................................ macOS 14.7.8 | MacBookAir M2 | iPadPro 2020 | Affinity Suite V1 - V2+ (always newest)
Old Bruce Posted August 9, 2022 Posted August 9, 2022 I would use the parenthesis to enclose what I want to be included. Then use the backslash \ and a number to indicate which set of parenthesis enclosed search terms I want to use in the replacement. Find: ^(.+)$ Replace: Here is the original search term: /1 Or... /1: That was the original search term. The /1 is what is in the parenthesis. Note that the $ is for the end of a line, you may not really need it because of the way .+ works for finding everything except a new line. elk 1 Mac Pro (Late 2013) Mac OS 12.7.6 Affinity Designer 2.6.0 | Affinity Photo 2.6.0 | Affinity Publisher 2.6.0 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that.
elk Posted August 9, 2022 Author Posted August 9, 2022 17 minutes ago, Old Bruce said: I would use the parenthesis to enclose what I want to be included. Then use the backslash \ and a number to indicate which set of parenthesis enclosed search terms I want to use in the replacement. Find: ^(.+)$ Replace: Here is the original search term: /1 Or... /1: That was the original search term. The /1 is what is in the parenthesis. Note that the $ is for the end of a line, you may not really need it because of the way .+ works for finding everything except a new line. Oh yes, I used that search in webdesign for replacing a whole line of image names with a complete image and thumb path which worked fine. What I needed was the reference, but /1 didn’t work it’s \1 Thanks for your fast reply, that was helpful! Old Bruce 1 Thanks for reading. ................................................................................ macOS 14.7.8 | MacBookAir M2 | iPadPro 2020 | Affinity Suite V1 - V2+ (always newest)
Old Bruce Posted August 9, 2022 Posted August 9, 2022 49 minutes ago, elk said: but /1 didn’t work That is what I originally wrote [slightly embarrassed smiley face emoticon]. It is early here on the left wet coast. I had to double check that myself before posting. elk 1 Mac Pro (Late 2013) Mac OS 12.7.6 Affinity Designer 2.6.0 | Affinity Photo 2.6.0 | Affinity Publisher 2.6.0 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that.
Recommended Posts