Seikilos Posted December 15, 2022 Share Posted December 15, 2022 broken_regex_replace.afpub Simple repro cases is attached. If I search for a style (=Strong) with regex like in this image there appear two locations where APub has found them. They are correct. However, double clicking on the location does not cause the main view to focus at this location ("jump to" seems broken). Replacing the match does also not work. When I hit `Replace all` nothing happens. Is there a workaround for this? I have 400 pages of styles for which I need markup ... Despite some short comings APub2 is really an improvement. Thank you 👍 Edit: I thought I found a workaround [only for paragraph styles]. Using the regex (.+) -> plus, not asterisk for matches. This seems to work on paragraphs well but not on character styles but this still mess my entire document up because all character styles are not updated. I will post a repro bellow. Quote Affinity User on Windows 11 Link to comment Share on other sites More sharing options...
walt.farrell Posted December 15, 2022 Share Posted December 15, 2022 I am a bit surprised at your replacement string having $ in it, rather than $1 or \1. I would have expected that to replace with a literal $ rather than the captured string. Other than that, I'm not sure what's happening, but I'll see if I can reproduce it. 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...
Seikilos Posted December 15, 2022 Author Share Posted December 15, 2022 It is a typo. I meant $1, but even a replacement by plain $ would be ok, if it would actually replace it. walt.farrell 1 Quote Affinity User on Windows 11 Link to comment Share on other sites More sharing options...
lacerto Posted December 15, 2022 Share Posted December 15, 2022 Obsolete. Seikilos 1 Quote Link to comment Share on other sites More sharing options...
Seikilos Posted December 15, 2022 Author Share Posted December 15, 2022 24 minutes ago, lacerto said: I think you need to specify search clause as: The behavior seems to be same in version 1, so .* seems to show the instance but does not seem to work when replacing (or focusing). This will mess up all my character styles that are "Strong" but do not match \w. What do you get during replacement when you keep your regex, set Replacement Character Style to Strong as well and then place a whitespace in the word `ante` making it `an te`? Hitting replacing all really causes havok in the file. Before: After: This looks like a disaster to be honest. With no proper way to diff my apub files beside exporting to pdf and version them this appears to me to be a "very" dangerous regex quirk. It would be somewhat ok to get `an te` having multiple <b>s resulting in `<b>an</b> <b>te</b>` but carrying the second match of the first Character style to the next match and replacing it is a little bit too weird. Relevant (Original) Quote Affinity User on Windows 11 Link to comment Share on other sites More sharing options...
walt.farrell Posted December 15, 2022 Share Posted December 15, 2022 It is true, though, that using (\w*) instead of (.*) allows replacement to work. So something odd is going on with the reg-ex search or replace processing. 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...
lacerto Posted December 15, 2022 Share Posted December 15, 2022 Obsolete. Quote Link to comment Share on other sites More sharing options...
Seikilos Posted December 15, 2022 Author Share Posted December 15, 2022 @lacerto try adding a white space in the word ante and try again. Quote Affinity User on Windows 11 Link to comment Share on other sites More sharing options...
lacerto Posted December 15, 2022 Share Posted December 15, 2022 Obsolete. Quote Link to comment Share on other sites More sharing options...
Seikilos Posted December 17, 2022 Author Share Posted December 17, 2022 I found a work around: Using (.+) instead of (.*) actually works as expected, but only for paragraphs. For Character styles it is still broken Yay. I wish the 4 hours of manual labour wouldn't be necessary but I am pretty sure I just saved many more hours for my next step. All is moot. I found another bug. Will create a repro Quote Affinity User on Windows 11 Link to comment Share on other sites More sharing options...
Seikilos Posted December 17, 2022 Author Share Posted December 17, 2022 Ok, here is the repro. File attached. next_regex_bug.afpub This is my starting position. I marked the strong elements in the text Now I hit replace all and the glyph range of strong changes. To be honest, this is the point I really regret choosing Publisher over InDesign (sadly not the first time) as I am now again vendor-locked and cannot export anything out of APub 2 that allows me to further process the data in other tools without manually redoing hours of work. (I know bugs are happening and what doesn't work for one customer, works for another and Serif is always committed to the cause, which I followed a long way but at the end results matter) [This last bit is written out of frustration, and while I do not expect that "everything" gets magically fixed all I can do is give a sincere feedback and hope for adjustments further down the road. I know you are working hard on the Affinity Suite.] Quote Affinity User on Windows 11 Link to comment Share on other sites More sharing options...
lacerto Posted December 17, 2022 Share Posted December 17, 2022 Obsolete. Quote Link to comment Share on other sites More sharing options...
Staff DWright Posted February 20, 2023 Staff Share Posted February 20, 2023 I have logged this issue with our developers. Quote 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.