Guest Posted August 22, 2021 Share Posted August 22, 2021 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. Quote Link to comment Share on other sites More sharing options...
walt.farrell Posted August 22, 2021 Share Posted August 22, 2021 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. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. iPad: iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1 Link to comment Share on other sites More sharing options...
Guest Posted August 23, 2021 Share Posted August 23, 2021 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. Quote Link to comment Share on other sites More sharing options...
Old Bruce Posted August 23, 2021 Share Posted August 23, 2021 Publisher uses 2029 and 2028 unicode for Paragraph and Line breaks.. 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...
Guest Posted August 23, 2021 Share Posted August 23, 2021 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. Quote Link to comment Share on other sites More sharing options...
garrettm30 Posted August 23, 2021 Share Posted August 23, 2021 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: uneMule 1 Quote Link to comment Share on other sites More sharing options...
uneMule Posted August 23, 2021 Share Posted August 23, 2021 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? 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. Quote Toujours pas !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 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.