elk Posted August 9, 2022 Share 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)) Quote Thanks for reading. ................................................................................macOS 10.13.6 | MacBookPro | 2.5 GHz Intel Core i5 | Affinity Suite Link to comment Share on other sites More sharing options...
Old Bruce Posted August 9, 2022 Share 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 Quote Mac Pro (Late 2013) Mac OS 12.7.4 Affinity Designer 2.4.1 | Affinity Photo 2.4.1 | Affinity Publisher 2.4.1 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that. Link to comment Share on other sites More sharing options...
elk Posted August 9, 2022 Author Share 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 Quote Thanks for reading. ................................................................................macOS 10.13.6 | MacBookPro | 2.5 GHz Intel Core i5 | Affinity Suite Link to comment Share on other sites More sharing options...
Old Bruce Posted August 9, 2022 Share 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 Quote Mac Pro (Late 2013) Mac OS 12.7.4 Affinity Designer 2.4.1 | Affinity Photo 2.4.1 | Affinity Publisher 2.4.1 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.