crdasneves Posted January 8, 2021 Share Posted January 8, 2021 Hi, In APub 1.8.5.703 (Windows 10) find and replace doesn't work properly when searching is done through the regex ".+" associated with any character format or style setting; in fact, each occurence is finded and listed, but it can't be replaced (it's not even selected in text) unless it's at the end of paragraph. When the regex is changed to "[a-z]+" or to "." OR the format is reset everything works fine (please see the file attached). I've found the same issue in beta 1.9.0.887. Is this a known bug? Am I missing something? Cheers, Cleber regex_test.afpub Quote Link to comment Share on other sites More sharing options...
walt.farrell Posted January 9, 2021 Share Posted January 9, 2021 Just to make sure I know what you were trying: What Regular Expression Options did you specify? What do you mean by "format bold"? Character Style > Strong, or something else? 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...
crdasneves Posted January 10, 2021 Author Share Posted January 10, 2021 12 hours ago, walt.farrell said: Just to make sure I know what you were trying: What Regular Expression Options did you specify? What do you mean by "format bold"? Character Style > Strong, or something else? Hi, Walt, 1. No options specified (just like the image above). 2. I've tried it first with local formatting (Format > Character font > Font weight > Bold), but got the same result with Format > Character style > Strong) Thanks! Quote Link to comment Share on other sites More sharing options...
walt.farrell Posted January 10, 2021 Share Posted January 10, 2021 Thanks. FYI, there's something a bit weird with your file, but it does not seem to be related to the problem. For example, the "r" in the first "regular" has a character style of Strong+, which shows in the Text Styles panel as being "Strong + Font Weight: Normal". So I created my own file, which does not have that problem, but it has the same issue. In playing around, I came up with this: If I search for .+ with a format of "font weight: bold" or character style Strong it fails. Substituting [a-z0-9 ]+ also fails. Substituting [a-z0-9]+ (without allowing a space) works. And substituting \w+ works. But substituting (\w| )+ fails, as does [\w ]+ So even though the bold/strong text does not have any spaces, if you specify a format option, and you have a pattern that allows matching a space, the search fails to work properly. Note: "Fails" in this post means that the correct text is found and shows up in the results list, but is not properly selected on the page and repeated pressing of Find does not advance to the next result in the results list. Here's my file, created in the 1.9 beta: regex_test2.afpub 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...
crdasneves Posted January 10, 2021 Author Share Posted January 10, 2021 Thank you very much for your test, Walt. It definitely seems to be related to research patterns that allow spaces. I hope this can be resolved soon. Cheers! Quote Link to comment Share on other sites More sharing options...
walt.farrell Posted January 10, 2021 Share Posted January 10, 2021 You're welcome. 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...
Staff Gabe Posted January 18, 2021 Staff Share Posted January 18, 2021 Hi both, Sorry for the delayed reply. Thanks for spotting this. Issue logged. walt.farrell 1 Quote Link to comment Share on other sites More sharing options...
crdasneves Posted January 20, 2021 Author Share Posted January 20, 2021 Thanks, Gabe! 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.