Jump to content
THESE FORUMS ARE READ-ONLY: Please Read Me ×

Recommended Posts

Posted

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)

Posted

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.

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.

Posted
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!

Thanks for reading.

................................................................................
macOS 14.7.8 | MacBookAir M2 | iPadPro 2020 | Affinity Suite V1 - V2+ (always newest)

Posted
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.

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.

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.