MikeA Posted March 15, 2020 Share Posted March 15, 2020 There's a thread here about searching and replacing text that includes the following suggestion: To find and delete text, select "regular expression" In the text within the Find field, don't use parens. Use "\1" alone in the Replace field. This does work. For example I had ;h2\s+ for the "find" expression and "\1" alone for the replacement. All occurrences of ";h2" followed by 1+ space(s) were deleted. Yes, it works, but it seems like a bit of a hack. So... • Is there another approach to execute a global find-and-delete operation throughout a long collection of text in linked text frames? In nearly all of the word processors and text editors I've used, an empty replacement field means: "delete." Is there some reason it shouldn't also mean "delete" in Publisher? (Not meant as a rhetorical question.) • I found that with the cursor at the start of the text, sometimes pressing the Find button caused the cursor to advance to the first "found location," and sometimes the cursor remained at the start of the text. This appears intermittent and I can't predict when it will happen. I'm assuming it is a bug. If it isn't a bug, what would the reason be for the "variable" behavior? Quote Affinity Publisher and Photo 1.8.3 (Windows). Lenovo laptop with decidedly sub-optimal monitor. At least it works.“The wonderful thing about standards is that you can have as many of ’em as you want.”– Anonymous cynic Link to comment Share on other sites More sharing options...
walt.farrell Posted March 15, 2020 Share Posted March 15, 2020 An empty Replace field works just fine for me to delete text, Mike. There's no need to use an uncaptured \1 to do the deletion. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7 Link to comment Share on other sites More sharing options...
MikeA Posted March 15, 2020 Author Share Posted March 15, 2020 @walt.farrell Alas, the empty replace field isn't working for me. When a 'find' occurs, the replacement field is empty, and I click 'Replace,' the program ignores what's just been found and moves on to the next 'find'. Quote Affinity Publisher and Photo 1.8.3 (Windows). Lenovo laptop with decidedly sub-optimal monitor. At least it works.“The wonderful thing about standards is that you can have as many of ’em as you want.”– Anonymous cynic Link to comment Share on other sites More sharing options...
MikeA Posted March 15, 2020 Author Share Posted March 15, 2020 More playing-around with it . . . An example of when it didn't work: I typed ;h2 (followed by a space) at the start of certain text I'd planned to make into subheadings. Then: Find: ";h2" (followed by a space) (this is a normal search, not a regex search) Replace: (nothing at all) — and format as Heading 2 Click: Replace All Result: the paragraphs in question are styled Heading 2 as expected. The string ";h2" is not deleted. Same result if Regular Expression is set and the find and replacement strings are the same as above. When it did work: Find: ";h2" (plus one space) (regex not set) Replace: (nothing at all) — and no change to text formatting. It also worked in this case: Find: ";h2" (then 1 space) — set "Regular Expression" Replace: "\1" — and format as Heading 2 Click: Replace All Result: the string ";h2" followed by a space was removed AND the paragraphs in question were formatted as Heading 2. Quote Affinity Publisher and Photo 1.8.3 (Windows). Lenovo laptop with decidedly sub-optimal monitor. At least it works.“The wonderful thing about standards is that you can have as many of ’em as you want.”– Anonymous cynic Link to comment Share on other sites More sharing options...
walt.farrell Posted March 15, 2020 Share Posted March 15, 2020 Thanks, I vaguely remember that. If you're setting formatting you do need a replace string. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7 Link to comment Share on other sites More sharing options...
MikeA Posted March 15, 2020 Author Share Posted March 15, 2020 57 minutes ago, walt.farrell said: Thanks, I vaguely remember that. If you're setting formatting you do need a replace string. What I observed might be intentional. When you're specifying a formatting change, the program can't know if you want it only to format the "found" text and move on to the next occurrence, or if you want to format it and delete the "found" string. So — safer to leave it alone. I'm glad the \1 workaround exists when Regular Expression is selected. Quote Affinity Publisher and Photo 1.8.3 (Windows). Lenovo laptop with decidedly sub-optimal monitor. At least it works.“The wonderful thing about standards is that you can have as many of ’em as you want.”– Anonymous cynic 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.