Jump to content

Find and replace (suggestions for improvement)


Recommended Posts

Find and replace with regular expressions

  • Ability to save regular expressions with names (with all settings, i.e. replace field, paragraph styles, etc.). Without this option, working with it hardly makes sense. When I check a longer text I first run through about 30 different regular expressions. It's a lot of work when I have to type them into the search field and the replace field by hand every time.
  • You should be able to see whether paragraph styles, character styles, etc. have been set.
  • \n not working. \n should only find line breaks.

Find and replace in general

  • Show number of hits.
  • "Replace" button, which only replaces, but does not look for the next hit. Often you want to check the first replacement.
  • "Replace and Find" button, that is, what Replace is currently doing.
  • "Search backwards" button.
  • After replacing, gray out the entry in the list - or delete it completely.
Link to comment
Share on other sites

1 hour ago, raddadist said:

\n not working. \n should only find line breaks.

In my experience, other regex engines that allow paragraphs work like Publisher does. Thus, /n does work, but all regex engines have some semantics that the user needs to learn and accomodate.

You can insert a Line Break from the pull-down in the Find field, even in a regex.

Other than that, good ideas. Thanks.

-- Walt

Desktop:  Windows 11 Home, version 22H2 (22621.1413) 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 
Laptop:  Windows 10 Home, version 21H2 (19044.2728) 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
        Affinity Photo 1.10.6 (.1665) and 2.0.4  and 2.1.0.1732 beta/ Affinity Designer 1.10.6 (.1665)  and 2.0.4  and 2.1.0.1732 beta / Affinity Publisher 1.10.6 (.1665)  and 2.0.4  and 2.1.0.1732 beta
iPad Pro M1, 12.9", iPadOS 16.3.1, Apple Pencil 2, Magic Keyboard

      Affinity Photo 1.10.7 and 2.0.4 and 2.1.0.1732 beta/ Affinity Designer 1.10.7 and 2.0.4 and 2.1.0.1732 beta/ Affinity Publisher 2.0.4 and 2.1.0.1732 beta

Link to comment
Share on other sites

I had seen that line breaks can be found in the pull down. It works.
Just wanted to point out that \r and \n should have different meanings in regular expressions.

I know it like this: \r finds paragraph breaks and \n finds line breaks.

Publisher makes no difference between \r and \n.
In both cases Publisher only finds paragraph breaks.

Link to comment
Share on other sites

 Publisher uses 2029 and 2028 unicode for Paragraph and Line breaks..

Mac Pro (Late 2013) Mac OS 11.7.3 
Affinity Designer 2.0.4 | Affinity Photo 2.0.4 | Affinity Publisher 2.0.4 | 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

That's right.
\x{2028} for line break and \x{2029} for paragraph break work.

\r and \n may not be used in the same way in all programs.
But I would find the distinction very useful – as it is made in InDesign.
\r and \n could make the regular expressions shorter and easier to read.

Link to comment
Share on other sites

5 hours ago, raddadist said:

Just wanted to point out that \r and \n should have different meanings in regular expressions.

I know it like this: \r finds paragraph breaks and \n finds line breaks.

 

I agree. There may be other programs that are like Publisher in this respect, but it is the first implementation of regex I have experienced that treats \r and \n as though they were identical. My favorite regex builder site (regex101.com) lists them as two separate meanings in the reference section:

1676635760_ScreenShot2021-08-23at11_31_28AM.png.513e5211378898308f1d726de2734dbd.png

Link to comment
Share on other sites

Bonsoir @all

This allows expressions to be copied or saved and ported to other environments.
The attached capture is a search for a column break (empty picto!?)
In the text block, copy/paste of searched character. Amusing, no?

grep.jpg

That said, it is a very interesting tool.

oops. I realised I had put the character in replace. Obviously, it's in search. But the result is the same.

 

1 cœur - 2 poumons - 1 chose à la fois.
Windows 10 Pro 21H2 - Intel Core i7-3630QM CPU @ 2.40GHz - 16 Gb Ram - GeForce GT 650M - Intel HD 4000
Affinity Photo | Affinity Designer | Affinity Publisher | 2.0.4

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...

Important Information

Please note there is currently a delay in replying to some post. See pinned thread in the Questions forum. These are the Terms of Use you will be asked to agree to if you join the forum. | 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.