Jump to content
You must now use your email address to sign in [click for more info] ×

Publisher Find/Replace "replace all" bugged when using some regular expressions


Recommended Posts

There seems to be a bug in Find-Replace, when using regular expressions with sets of characters and "replace all" function. The characters get replaced with a random character from the set. Example follows.

I am finding conjunctives from this set with space after them and replacing that space with a non-breaking one.  
Find: (\b)(a|i|o|u|w|z|A|I|O|U|W|Z|ze|Ze|nr|Nr|Za|za|We|we|Dr|dr)(\b )
Replace: \2[NBSP]

If I go one by one (use replace), everything works fine. But the second I use "replace all", some of the conjunctives get replaced with random other ones (some "o"s will become "W"s and so on). Not all of them get replaced like that, and it can be different ones that get replaced with each attempt. Type of document does not matter (tried newly-created, imported etc.).


As I read in this topic, this used to work fine in V.1, but is broken in V.2. In this topic, there are also more people that experienced this issue.

I'm attaching a test file and a screenshot (on the screenshot, the same page before and after running the "replace all"). But, as I said, it works the same in any file for me.

Additional information:

  • Using latest version
  • 100% reproducible
  • Happens for new documents, old documents, any documents
  • Operating system: Windows 10
  • Hardware acceleration is on, tried turning it off (didn't change anything)
  • No unusual relevant hardware or software connected/running.

Steps to reproduce:

  • Open the document
  • Take a screenshot of a page (for future reference, so you can compare)
  • Put a query "(\b)(a|i|o|u|w|z|A|I|O|U|W|Z|ze|Ze|nr|Nr|Za|za|We|we|Dr|dr)(\b )" in "Find". Without quotes.
  • Put "\2[NBSP]" in "Replace". Without quotes, [NBSP] should of course be replaced with non-breaking space.
  • Press "replace all"
  • Compare your new page with your screenshot, and you will see that some of the conjunctives have been replaced with other ones.

grep_test.jpg

grep_test.afpub

Link to comment
Share on other sites

I don't have your font. I have it replaced by Helvetica by Publisher. I don't see your example being changed from a w to an i on page one. I copied the text from Publisher before running the Find and Replace and pasted it into a plain text text file. I then ran your script and copied and pasted into another plain text text file. I looked randomly at the "find differences" window for the differences but couldn't find any. I am not going to go through all the hundreds (thousands?) of changes but I include the text files for others to look at. grep 1.txt is the text from the opened file, grep 2.txt is after the replacement.

Publisher grep test.zip

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

17 minutes ago, fabula_rasa said:

I see you're on Mac. What if the bug is only in Windows version?

True, or it may be due to some weird issue with the font you used in conjunction with the languages you have on your machine compared to mine. Or those factors could exacerbate a Windows only bug.

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

Font definitely doesn't matter. In various documents, I used various fonts - same result. And those guys from the forum topic I linked (who have the same issue) surely have at least some different languages on their systems (original poster is Czech, so I'm assuming he will have Czech language installed :), which I do not).

Link to comment
Share on other sites

I am not seeing any obvious differences when I run the Find/Replace you suggested, against your document, @fabula_rasa.

Like @Old Bruce I don't particularly want to look at every one of the differences but I ran the before and after through a "diff" program and so far everything looks fine.

----

I am a bit concerned about one thing, however: I cannot get your Find string to work at all in 2.2.1.2075 beta. It always gives "no results found". If another user could try your document and that string in 2.2.1.2075 I would appreciate it (ideally, users on both Windows and Mac, unless @Old Bruce was using the beta for his testing already on Mac).

-- 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

7 minutes ago, walt.farrell said:

I am a bit concerned about one thing, however: I cannot get your Find string to work at all in 2.2.1.2075 beta. It always gives "no results found". If another user could try your document and that string in 2.2.1.2075 I would appreciate it (ideally, users on both Windows and Mac, unless @Old Bruce was using the beta for his testing already on Mac).

I just checked on Mac with the 2075 beta and I have the same results as before, no obvious problem. Walt, did you have the font which was used, Sitka*?

 

*Which isn't that far from me, compared to the distance to Poland, if in fact that is Polish text.

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

1 hour ago, Old Bruce said:

Walt, did you have the font which was used, Sitka*?

Yes. Edit: No; please see below.

-- 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

1 hour ago, Old Bruce said:

Walt, did you have the font which was used, Sitka*?

As it turns out, no, I don't have Sitka. At least, according to the Font Manager.

But it's odd, because when I Open the file, in either 2.2.0 or 2.2.1.2075, there is no obvious indication that the font is missing:

  1. There is no popup message ("toast") that the document has a missing font.
  2. The Context Toolbar shows the font as Sitka, in white and with no ? (I would expect red and with a ?).
  3. There is no Preflight error forr a missing font.

The Font Manager says it is missing, and that Arial has been substituted. But there should have been some other indication. This has happened on both my Windows machines (one of which uses the MSIX installers and the other uses EXE).

----

Then I noticed that in the Context Toolbar, the Font Style field was blank, which is odd. So I clicked on it, and I got a bunch of styles all named "text". Apparently, Sitka is a standard font on Windows (at least, I seem to have it on both machines and don't remember installing it) or is installed by some software I have on both machines, and it's a Variable font. If I look in the Windows Fonts folder, and look at the Properties of those fonts, the Sitka fonts have names like SitkaVF-Italic.ttf

-- 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

6 minutes ago, fabula_rasa said:

Sitka is a standard Windows font. I thought it would be a good idea to use one of those in this test file, as anyone opening it on Windows will have the font. 

Thanks, but it was a bit weird as it's Variable, which the Affinity apps don't support. 

For the purpose of your bug report that shouldn't matter, though. :)

-- 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

10 hours ago, fabula_rasa said:

Steps to reproduce:

  • Open the document
  • Take a screenshot of a page (for future reference, so you can compare)
  • Put a query "(\b)(a|i|o|u|w|z|A|I|O|U|W|Z|ze|Ze|nr|Nr|Za|za|We|we|Dr|dr)(\b )" in "Find". Without quotes.
  • Put "\2[NBSP]" in "Replace". Without quotes, [NBSP] should of course be replaced with non-breaking space.
  • Press "replace all"
  • Compare your new page with your screenshot, and you will see that some of the conjunctives have been replaced with other ones.

I cannot reproduce it on win 10. Publisher 2.2.1.2063 beta

 

 

 

Link to comment
Share on other sites

This reminds me of something that happenend to me. It looked like the first instance found was copied and then pasted in the next instances found,

For example:

Find (regular expresssion): (<i>)(.+?)(</i>)

Replace with: $2 + character style ‘italic’.

In words: find markups for italic text and any text between them.
Replace with whatever is between the second set of parentheses and apply character style ‘italic’.

When using ‘Replace All’, Publisher found (<i>)some text(</i>) and replaced it with some text – as expected.

Then (<i>)some other words(</i>) was replaced with some text.

Then (<i>)something completely different(</i>) was replaced with some text.

And so on.

When replacing one by one, it went as expected.

Macbook Pro mid 2015, 16 GB, double barrel: MacOS Mojave + Affinity 1 (+ Adobe’s CS6)/ MacOS Monterey + Affinity 2

Link to comment
Share on other sites

I have found a way to do a full comparison using your file and regular expression, @fabula_rasa, and Publisher is not making any mistakes on 2.2.0 or 2.2.1.2075 for me, on Windows. 

-- 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

5 hours ago, anto said:

For me it works well

Thanks. And yes, as I mentioned in my Edit, it was a problem with the Options.

-- 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

  • Staff

Hi @fabula_rasa,

Much to the same result as the other's i've also not been able to replicate this in 2.2.0 release using your expression and document and this has worked as expected when using 'Replace All'.

However, I also happen to have a 2.0.4 MSIX installation of Publisher on my Windows Machine, this was the build version which I originally logged the differing results in Replace/Replace All issue on with the developers based on the thread you linked in your original post. After pasting your document's text into a new blank document and then following your recipe and expression again the same I can now replicate the issue in the 2.0.4 app.

I'm aware you mentioned that you're running the latest version in your post, but to be certain have you checked the version number that Publisher is listed as in Help > About? If it's the latest release it should report as 2.2.0. It's worth noting that the 'Replace all' issue was also present in the 2.1.X update.

Even if the app report's it's running 2.2.0 it may be worth just going through uninstalling and re-installing from the 2.2.0 installer just to rule out there being any irregularities and then seeing if it starts working.

 

Link to comment
Share on other sites

  • Staff

Thanks for checking, if the problem continues following the re-install, could you confirm if you're installing the MSIX version of the app (.MSIX installer package file) or if you're installing the MSI version (.EXE installer file)? I would be surprised if this was an issue that only affects MSIX since they should behave the same, but I would just like to confirm. 🙂

Link to comment
Share on other sites

So, I uninstalled, got rid of any stray config files and reinstalled. This time from .exe, just in case 😀

Sadly, it didn't help. The same thing happens. I'm attaching a short vid and screenshots. In the vid, I quickly mark a few of the characters that got replaced - just those that I noticed at first glance. Screenshot is from that video.

If it matters, I created a brand new file for this test (which I'm also attaching in its initial version - before the "replace all").

test2.png

2023-10-18 00-40-14.mkv test2.afpub

Link to comment
Share on other sites

  • Staff

Hi @fabula_rasa,

Thanks for trying, it's worth noting that the logged issue with 'replace all' producing different results isn't officially marked as fixed in v2.2.0 internally and is still outstanding, though the fact that other users in the thread (including myself) have not yet been able to replicate this in the 2.2.0 release build indicates that there has potentially been some change/improvement since the original problem was logged. To help rule out some environmental factors, I have now tested this on a different Windows 10 machine in 2.2.0 MSI and MSIX apps and this has worked every time for me.

- It would worth trying this on a completely different document you created from scratch in 2.2.0 rather than working on the same test file.

- Try the 2.2.1 beta and see if this has any impact, as this creates a completely different local user settings directory

- Try resetting your app's tool and panel defaults by launching Publisher whilst still holding CTRL, and then pressing 'Clear' on the 'Clear user data' menu box that appears before trying again.

Link to comment
Share on other sites

Hi @NathanC!

- As I said in my previous post: "If it matters, I created a brand new file for this test". I create a file from scratch for every one of those tests :)

- I tried resetting, as you suggested, it sadly changed nothing.

- I cannot seem to find the 2.2.1 beta download. I clicked on "join the beta program" and all I got is links to 2.2.0 betas. No other betas in my "downloads & product keys" section. Should I be looking somewhere else? Can you send me link or something of the sort to the 2.2.1? Sorry if it's a stupid question, and I'm missing something obvious. I never use betas of any software, as I am a big bug magnet as it is ;), and betas tend to be buggier than stable releases.

 

Thanks for all the help. 

 

Screenshot_3.jpg

Link to comment
Share on other sites

1 hour ago, fabula_rasa said:

and all I got is links to 2.2.0 betas

The Windows downloads are 2.2.1 beta, but they're mislabeled.

(The Mac downloads are 2.2.0, which then allow updating to 2.2.1.)

 

 

-- 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

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...
×
×
  • Create New...

Important Information

Terms of Use | 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.