Wojciech Krakowiak Posted April 26, 2019 Posted April 26, 2019 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 Without this fix, this GREP rule is useless in polish language, because we have a lot combinations like " i w ", " a w " test.afpub
Seneca Posted April 26, 2019 Posted April 26, 2019 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
walt.farrell Posted April 26, 2019 Posted April 26, 2019 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
Seneca Posted April 26, 2019 Posted April 26, 2019 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
Old Bruce Posted April 26, 2019 Posted April 26, 2019 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. walt.farrell 1 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.
walt.farrell Posted April 26, 2019 Posted April 26, 2019 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
Wojciech Krakowiak Posted April 27, 2019 Author Posted April 27, 2019 @Seneca @Old Bruce @walt.farrell – wow, thanks for your interest and discussion. However, publisher still changes position of the conjunctions. See screenshots: before, after and what happened
Wosven Posted April 27, 2019 Posted April 27, 2019 (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_ Comment: [abc] expression will select a (ONE) character depending of the ones listed between the brackets, no need to use "or" (the "|"). Edited April 27, 2019 by Wosven Added comment
Seneca Posted April 27, 2019 Posted April 27, 2019 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 Sean P Posted May 3, 2019 Staff Posted May 3, 2019 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.
Staff Patrick Connor Posted May 31, 2019 Staff Posted May 31, 2019 We believe this has been addressed in the latest (#371) beta build. Please retest this behaviour. Patrick Connor Serif Europe Ltd Latest V2 releases on each platform Help make our apps better by joining our beta program! "There is nothing noble in being superior to your fellow man. True nobility lies in being superior to your previous self." W. L. Sheldon
Recommended Posts