Jump to content

Recommended Posts

Posted

Here's the case: I want to place a non-breaking space before all conjunctions in document.

I use this GREP rule:
find: (\b)(a|i|o|u|w|z|A|I|O|I|W|Z)(\b\s)
replace: $2$3

Everything works fine until it meets two following conjunctions, like "i w". Then it changes this expression into "I", and the second conjunction "w" gets moved to the place of next conjunction in document and all following conjunctions in document get moved to the place of next conjunctions.

To clarify it, download Publisher document that I attach, use the mentioned grep rule and see what happens with all conjunctions.

I hope this is understandable :D

Without this fix, this GREP rule is useless in polish language, because we have a lot combinations like " i w ", " a w "

 

test.afpub

Posted
2 hours ago, Wojciech Krakowiak said:

I want to place a non-breaking space before all conjunctions in document.

Hello @Wojciech Krakowiak.

Your find Grep adds space (not the non-breaking space) after the conjunction and not before.

I modified your grep slightly. Please test it now and let me know whether this works for you now.

FIND: \b(a|i|o|u|w|z|A|I|O|I|W|Z)\b\s

REPLACE: $1(add the non breaking space from the pop up menu)

 

Edit: This ads the non-breaking space after the conjunction. I think this is what you want.

2017 27” iMac 4.2 GHz Quad-Core Intel Core i7 • Radeon Pr 580 8GB • 64GB • Ventura 13.6.4.

iPad Pro (10.5-inch) • 256GB • Version 16.4

Posted
3 hours ago, Wojciech Krakowiak said:

(a|i|o|u|w|z|A|I|O|I|W|Z)

By the way, shouldn't that be (a|i|o|u|w|z|A||O|U|W|Z) instead?

-- 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 18.5, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.5

Posted
10 minutes ago, walt.farrell said:

(a|i|o|u|w|z|A||O|U|W|Z)

Well spotted.

However, even this one has a small typo :-):

(a|i|o|u|w|z|A||O|U|W|Z)

2017 27” iMac 4.2 GHz Quad-Core Intel Core i7 • Radeon Pr 580 8GB • 64GB • Ventura 13.6.4.

iPad Pro (10.5-inch) • 256GB • Version 16.4

Posted
49 minutes ago, Seneca said:

Well spotted.

However, even this one has a small typo :-):

(a|i|o|u|w|z|A||O|U|W|Z)

I think there is a missing EYE in there.

Mac Pro (Late 2013) Mac OS 12.7.6 
Affinity Designer 2.6.0 | Affinity Photo 2.6.0 | Affinity Publisher 2.6.0 | Beta versions as they appear.

I have never mastered color management, period, so I cannot help with that.

Posted
1 hour ago, Seneca said:

Well spotted.

However, even this one has a small typo :-):

(a|i|o|u|w|z|A||O|U|W|Z)

Almost. (a|i|o|u|w|z|A|I|O|U|W|Z)

Thanks. I knew I had messed it up, but thought I had fixed it before.

-- 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 18.5, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.5

Posted (edited)

You can use simpler expressions, and run it twice (for the second one in  "i w") :

_space_([aiouwzAIOUWZ])_space_

replace with:

_nobreakSpace_$1_space_

2019-04-27_093841.png.d75216ce12b58210bb256e84a38299b5.png

 

 

Comment: [abc]  expression will select a (ONE) character depending of the ones listed between the brackets, no need to use "or" (the "|").

Edited by Wosven
Added comment
Posted
9 hours ago, Wojciech Krakowiak said:

wow, thanks for your interest and discussion.

The GREP below works for me.

I made the assumption that any 1 letter word needs to be connected to the next word. That pretty much covers all the cases:

FIND: \b(\w)\b\s

REPLACE: $1(non-breaking space)

Edit: Wait. This still moves the one letter words around. I definitely think that this is a bug.

2017 27” iMac 4.2 GHz Quad-Core Intel Core i7 • Radeon Pr 580 8GB • 64GB • Ventura 13.6.4.

iPad Pro (10.5-inch) • 256GB • Version 16.4

  • Staff
Posted

Hi guys! Thank you very much for your help with this! I've reproduced the issue - it seems to be gobbling up the first 'w' after the i and then replacing all the other single letter conjuctions shifted 1 letter along.

I'll get this passed on to development.

  • 4 weeks later...
×
×
  • 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.