Horizon3 Posted August 1, 2023 Share Posted August 1, 2023 Hello All, I know the GREP topic has been discussed extensively on the forum and I sincerely hope my questions are not repetitive (I have searched the forum but have not found the answers to my questions, which makes me hopeful my questions will not be duplicates). Using the find/replace function, how do you 1). Change Multiple Space to Single space in a document? 2). Find Multiple Return and change to Single return? 3). Remove spaces at the beginning and end of paragraphs? 4). Remove extra tabs? 5). Change straight quotes to curly quotes? Please realise I have zero knowledge about GREP. I only know that 2 of the 5 tasks outlined in my questions are carried out using GREP and so I need to know how to do these things in APu. Thank you. Quote Link to comment Share on other sites More sharing options...
anto Posted August 2, 2023 Share Posted August 2, 2023 4 hours ago, Horizon3 said: 1). Change Multiple Space to Single space in a document? \s+ ---> space 4 hours ago, Horizon3 said: 2). Find Multiple Return and change to Single return? Goto Find->Special characters->Paragraph Break add + at the end and replace with Paragraph Break 4 hours ago, Horizon3 said: 3). Remove spaces at the beginning and end of paragraphs? In the beginning: ^\s+ ---> space at the end: (\s)+ paragraph break sign replace to paragraph break 4 hours ago, Horizon3 said: 4). Remove extra tabs? Goto Find->Special characters->Tab add + and replace with Tab 4 hours ago, Horizon3 said: 5). Change straight quotes to curly quotes? copy quotes which you want to replace and paste them into the appropriate windows Horizon3 1 Quote Link to comment Share on other sites More sharing options...
walt.farrell Posted August 2, 2023 Share Posted August 2, 2023 You might find this web site of interest for learning more about Regular Expression processing: https://www.regular-expressions.info Horizon3 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...
Horizon3 Posted August 2, 2023 Author Share Posted August 2, 2023 @anto many thanks! I was going to ask you how you know these GREP commands (i.e., where you learned them) so I could learn them, but @walt.farrell removed the need for that question. Thank you, Walt, for sharing that website. Before posting my questions, I searched and found other websites about regular expressions but it seems the websites were for seasoned programmers so everything was codswallop to me. Regular Expressions info seems to be written with true beginners like myself in mind. Again my thanks. walt.farrell 1 Quote Link to comment Share on other sites More sharing options...
anto Posted August 2, 2023 Share Posted August 2, 2023 2 hours ago, Horizon3 said: I was going to ask you how you know these GREP commands (i.e., where you learned them) I didn't study them. I looked it up myself on Internet. I often have to edit a lot of text, and to make my life easier, I first look for ways to automate this process. Then everything is very easy to edit. For practice, you can also use the website https://regex101.com/ Quote Link to comment Share on other sites More sharing options...
Horizon3 Posted August 3, 2023 Author Share Posted August 3, 2023 6 hours ago, anto said: I didn't study them. I looked it up myself on Internet. I see. 6 hours ago, anto said: I often have to edit a lot of text, and to make my life easier, I first look for ways to automate this process. Then everything is very easy to edit. Yes, that's why I need to learn how to use them. I've used regular expressions/ GREP before but only the ones I asked about. However, they made the layout and editing process so much easier that they're one of the first things I looked for in APu. And thanks for the website recommendation. I came across that sight when I was trying to find the answers to my questions before I posted them. No idea how to use that sight but maybe once I complete the tutorial on https://www.regular-expressions.info, it will start making sense. Quote Link to comment Share on other sites More sharing options...
Catshill Posted August 3, 2023 Share Posted August 3, 2023 On 8/2/2023 at 5:06 AM, anto said: On 8/2/2023 at 12:08 AM, Horizon3 said: 2). Find Multiple Return and change to Single return? Goto Find->Special characters->Paragraph Break add + at the end and replace with Paragraph Break I find APu unable to find paragraph breaks with Find and Replace. I thought this was a bug? Ref Quote Link to comment Share on other sites More sharing options...
walt.farrell Posted August 3, 2023 Share Posted August 3, 2023 1 hour ago, Catshill said: I find APu unable to find paragraph breaks with Find and Replace. I thought this was a bug? Ref That topic is about something entirely different. It would be better for you to start a new topic and explain your problem, with screenshots and if possible a sample .afpub document that demonstrates the problem. 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...
R C-R Posted August 3, 2023 Share Posted August 3, 2023 6 hours ago, walt.farrell said: That topic is about something entirely different. It would be better for you to start a new topic and explain your problem, with screenshots and if possible a sample .afpub document that demonstrates the problem. In the 'Datamerger' topic mentioned above I replied to @Catshill's comment there with what I believe to be an explanation of how F&R can be used to find paragraph & other breaks.... Quote All 3 1.10.8, & all 3 V2.4.2 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7 Affinity Photo 1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7 Link to comment Share on other sites More sharing options...
Catshill Posted August 3, 2023 Share Posted August 3, 2023 10 hours ago, walt.farrell said: That topic is about something entirely different. It would be better for you to start a new topic and explain your problem, with screenshots and if possible a sample .afpub document that demonstrates the problem. That topic was but this one isn’t. R C-R 1 Quote Link to comment Share on other sites More sharing options...
R C-R Posted August 3, 2023 Share Posted August 3, 2023 14 minutes ago, Catshill said: That topic was but this one isn’t. So it is unclear why you posted about it here? Quote All 3 1.10.8, & all 3 V2.4.2 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7 Affinity Photo 1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7 Link to comment Share on other sites More sharing options...
walt.farrell Posted August 3, 2023 Share Posted August 3, 2023 17 minutes ago, Catshill said: That topic was but this one isn’t. Thus one is also another user's topic about specific problems they are having. For your problem, it would be better to post your own topic, especially if you think the application is not working correctly. 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...
Catshill Posted August 4, 2023 Share Posted August 4, 2023 @walt.farrell @R C-R I thought this was already registered as a bug but given not, point taken and my apologies. I’ll start a new thread. walt.farrell 1 Quote Link to comment Share on other sites More sharing options...
artjourney Posted August 17, 2023 Share Posted August 17, 2023 Someone should definitely start a thread where regular expressions snippets like this are stored in one place. I’m sure a lot of us here have similar problems that can be solved with RegEx. On 8/2/2023 at 12:06 AM, anto said: \s+ ---> space Goto Find->Special characters->Paragraph Break add + at the end and replace with Paragraph Break In the beginning: ^\s+ ---> space at the end: (\s)+ paragraph break sign replace to paragraph break Goto Find->Special characters->Tab add + and replace with Tab copy quotes which you want to replace and paste them into the appropriate windows Horizon3 1 Quote Link to comment Share on other sites More sharing options...
Horizon3 Posted August 17, 2023 Author Share Posted August 17, 2023 An excellent idea @artjourney! 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.