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

Publisher: one-character prepositions don't work in V2


Recommended Posts

On 2/15/2023 at 10:49 AM, pgraficzny said:

And this regular expression and replacement text are the best. And I think that's what it was all about.

Zrzut ekranu (90).png

Zrzut ekranu (92).png

May I please know where you got the book (Děti to chtěj vědět taky)? Because I was involved in its creation, but we made it in InDesign. Thanks. 😄

Link to comment
Share on other sites

Thank you @pgraficzny your solution works but you must use this only if you are done with whole text. Because the syntax (\s[iuawzoIUAWZO])(\s) find both spaces. Non breaking and basic space. So if you use it for search and then replace all then it works. But If you edit or add some text. Then you use syntax (\s[iuawzoIUAWZO])(\s) for search again it will find every space again. Then after using replace all it will add one more space before single letters. After another search another space before letters.

Snímka obrazovky 2023-02-17 o 7.57.39.png

Link to comment
Share on other sites

2 hours ago, bajqo said:

Thank you @pgraficzny your solution works but you must use this only if you are done with whole text. Because the syntax (\s[iuawzoIUAWZO])(\s) find both spaces. Non breaking and basic space. So if you use it for search and then replace all then it works. But If you edit or add some text. Then you use syntax (\s[iuawzoIUAWZO])(\s) for search again it will find every space again. Then after using replace all it will add one more space before single letters. After another search another space before letters.

Snímka obrazovky 2023-02-17 o 7.57.39.png

This is why I usually use (\s\b.{1,2}\b)\s - also previously described. You can repeat many times and spaces are not duplicated.

Link to comment
Share on other sites

2 hours ago, pgraficzny said:

This is why I usually use (\s\b.{1,2}\b)\s - also previously described. You can repeat many times and spaces are not duplicated.

Thanky.

If i change the expresion to (\s\b.{1,2,3}\b)\s expr it will find three letter words too?

For replace you use \1<NBSP> ?

Link to comment
Share on other sites

1 hour ago, bajqo said:

If i change the expresion to (\s\b.{1,2,3}\b)\s expr it will find three letter words too?

The syntax of {} is {min,max} so no, that won't work. But {1,3} should.

-- 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 months later...

This bug is still around! With expressions where you give a set of specific letters/numbers/clumps of letters, Affinity just decides that it's fine to replace some of them with another random one from a set. So with an expression formulated like this:

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]

we get randomly "o" becoming "w" and so on.

The query posted by pgraficzny works fine (thanks for that, by the way :)). But it's very general. And if I only want to find/replace some specific set of things (e.g. specific list of various scientific titles or not all two-letter words), it is no longer valid.

The bug only happens when you "replace all". If you go one by one, it works as intended. Type of document does not matter (tried newly-created, imported, old, new etc.).

Any chance it will be fixed? As I read in this thread that it worked fine in v. 1.

grep_test.jpg

Link to comment
Share on other sites

16 minutes ago, fabula_rasa said:

This bug is still around! With expressions where you give a set of specific letters/numbers/clumps of letters, Affinity just decides that it's fine to replace some of them with another random one from a set. So with an expression formulated like this:

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]

we get randomly "o" becoming "w" and so on.

I don't think that "this bug" has been reported. If you have a sample document that can be used to demonstrate it, that would be useful.

 

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

Just now, walt.farrell said:

I don't think that "this bug" has been reported. If you have a sample document that can be used to demonstrate it, that would be useful.

 

Sure. Occurs in any and all documents for me. Here, have a test one I made today (the one I made a screenshot from).

If it wasn't reported, I will do it now. I assumed (silly, I admit) that the original poster reported it.

grep_test.afpub

Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...
On 2/17/2024 at 12:14 AM, Klababa said:

Tohle mi funguje:

najít

(\<[szkvaiouSZKVAIOU])[ ]+

zaměnit

$1<NBSP>

bez mezery před "$1"

Funguje aj s predložkami ako sú na, sa, do, alebo aby, asi, ale ... 

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.