pgraficzny Posted February 15, 2023 Share Posted February 15, 2023 For me this regex works in version 1 and version 2, in Polish. Quote Link to comment Share on other sites More sharing options...
pgraficzny Posted February 15, 2023 Share Posted February 15, 2023 And this regular expression and replacement text are the best. And I think that's what it was all about. Quote Link to comment Share on other sites More sharing options...
Stepaan Posted February 16, 2023 Author Share Posted February 16, 2023 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. 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. 😄 Quote Link to comment Share on other sites More sharing options...
pgraficzny Posted February 16, 2023 Share Posted February 16, 2023 10 hours ago, Stepaan said: 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. 😄 From this topic, a few posts earlier. Quote Link to comment Share on other sites More sharing options...
pgraficzny Posted February 17, 2023 Share Posted February 17, 2023 On 11/15/2022 at 10:12 PM, Stepaan said: 🙂 Thank you. The loukash's way works, mine doesn't. In V2... Look for all single characters at the end of a row. One_char_prep.afpub From here 🙂 Quote Link to comment Share on other sites More sharing options...
bajqo Posted February 17, 2023 Share Posted February 17, 2023 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. Quote Link to comment Share on other sites More sharing options...
pgraficzny Posted February 17, 2023 Share Posted February 17, 2023 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. 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. Quote Link to comment Share on other sites More sharing options...
bajqo Posted February 17, 2023 Share Posted February 17, 2023 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> ? Quote Link to comment Share on other sites More sharing options...
Seneca Posted February 17, 2023 Share Posted February 17, 2023 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? Hello @bajqo, No you need this (\s\b.{1,3}\b)\s. bajqo 1 Quote 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 Link to comment Share on other sites More sharing options...
walt.farrell Posted February 17, 2023 Share Posted February 17, 2023 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. bajqo 1 Quote -- 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 More sharing options...
bajqo Posted February 17, 2023 Share Posted February 17, 2023 34 minutes ago, Seneca said: Hello @bajqo, No you need this (\s\b.{1,3}\b)\s. Great. Thank you. Quote Link to comment Share on other sites More sharing options...
pgraficzny Posted February 17, 2023 Share Posted February 17, 2023 8 hours ago, bajqo said: 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> ? Look at the screen, after \1 I choose Non-Breaking Space from the context menu. bajqo 1 Quote Link to comment Share on other sites More sharing options...
fabula_rasa Posted October 15, 2023 Share Posted October 15, 2023 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. Quote Link to comment Share on other sites More sharing options...
walt.farrell Posted October 15, 2023 Share Posted October 15, 2023 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. Quote -- 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 More sharing options...
fabula_rasa Posted October 15, 2023 Share Posted October 15, 2023 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 walt.farrell 1 Quote Link to comment Share on other sites More sharing options...
Klababa Posted February 16 Share Posted February 16 Tohle mi funguje: najít (\<[szkvaiouSZKVAIOU])[ ]+ zaměnit $1<NBSP> bez mezery před "$1" Quote Link to comment Share on other sites More sharing options...
bajqo Posted March 19 Share Posted March 19 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 ... 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.