Old Bruce Posted October 16, 2020 Share Posted October 16, 2020 8 minutes ago, Petar Petrenko said: I don't want to involve numbers. This will do letters only Find: ([A-z]\.)([A-z]) Petar Petrenko 1 Quote Mac Pro (Late 2013) Mac OS 12.7.6 Affinity Designer 2.5.5 | Affinity Photo 2.5.5 | Affinity Publisher 2.5.5 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that. Link to comment Share on other sites More sharing options...
Old Bruce Posted October 16, 2020 Share Posted October 16, 2020 1 hour ago, Petar Petrenko said: For example, when you change bold local formating with bold character style, it also formats bold titles, which is logical. But now, if you change the title paragraph style from bold to black it doesn't change it because character styles override character seting inside paragraph style. So, you have to select the title and change the character style from bold to [None] and only then the title becomes black. Not sure I completely understand what you need but I would search in Body Text Paragraph Style to skip all the Title Paragraph Styles. And then do a search in Title Paragraph Style to change to Bold or Black Character style, or to just change to no style character style which will change it to local formating bold. Further, there are the various methods of applying different Paragraph Styles but keeping or losing local and or character formatting. Now comes the 'but'. But I am unaware of any method to apply these options using the Find and Replace though so if that is what you are after then we are out of luck. Quote Mac Pro (Late 2013) Mac OS 12.7.6 Affinity Designer 2.5.5 | Affinity Photo 2.5.5 | Affinity Publisher 2.5.5 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that. Link to comment Share on other sites More sharing options...
Seneca Posted October 16, 2020 Share Posted October 16, 2020 1 hour ago, Petar Petrenko said: So, you have to select the title and change the character style from bold to [None] and only then the title becomes black. Can't you run Find and Replace character styles to [None] on all headings as a second step? 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...
Petar Petrenko Posted October 16, 2020 Author Share Posted October 16, 2020 1 minute ago, Old Bruce said: Not sure I completely understand what you need but I would search in Body Text Paragraph Style to skip all the Title Paragraph Styles. And then do a search in Title Paragraph Style to change to Bold or Black Character style, or to just change to no style character style which will change it to local formating bold. Further, there are the various methods of applying different Paragraph Styles but keeping or losing local and or character formatting. Now comes the 'but'. But I am unaware of any method to apply these options using the Find and Replace though so if that is what you are after then we are out of luck. When the text is placed into InDesign or Publisher in the beggining it has no styles. I first: clean the white spaces, remove extra space(s) before punctuation marks, add extra space after punctuation marks (to avoid glued words), again replace 2 spaces with 1, then remove empty paragraphs and, at the end, I change local character formating with character styles (bold, italic, bold italic superscipt, underline...). At this point, future titles get Bold character style and whatever you chose for the font in Title paragraph style (Italic, Bold Italic, Black, Condensed...) it is still Bold unless you remove Bold character style from it which is step no. 7. Now you can see why I need RegEx badly. If paragraph styles do not reset local formating, steps 6 and 7 could be easily avoided and save a precious time. Quote All the latest releases of Designer, Photo and Publisher (retail and beta) on MacOS and Windows. 15” Dell Inspiron 7559 i7 ● Windows 10 x64 Pro ● Intel Core i7-6700HQ (3.50 GHz, 6M) ● 16 GB Dual Channel DDR3L 1600 MHz (8GBx2) ● NVIDIA GeForce GTX 960M 4 GB GDDR5 ● 500 GB SSD + 1 TB HDD ● UHD (3840 x 2160) Truelife LED - Backlit Touch Display 32” LG 32UN650-W display ● 3840 x 2160 UHD, IPS, HDR10 ● Color Gamut: DCI-P3 95%, Color Calibrated ● 2 x HDMI, 1 x DisplayPort 13.3” MacBook Pro (2017) ● Ventura 13.6 ● Intel Core i7 (3.50 GHz Dual Core) ● 16 GB 2133 MHz LPDDR3 ● Intel Iris Plus Graphics 650 1536 MB ● 500 GB SSD ● Retina Display (3360 x 2100) Link to comment Share on other sites More sharing options...
Petar Petrenko Posted October 16, 2020 Author Share Posted October 16, 2020 6 minutes ago, Seneca said: Can't you run Find and Replace character styles to [None] on all headings as a second step? Yes, but this is additional step that can be avoided. Quote All the latest releases of Designer, Photo and Publisher (retail and beta) on MacOS and Windows. 15” Dell Inspiron 7559 i7 ● Windows 10 x64 Pro ● Intel Core i7-6700HQ (3.50 GHz, 6M) ● 16 GB Dual Channel DDR3L 1600 MHz (8GBx2) ● NVIDIA GeForce GTX 960M 4 GB GDDR5 ● 500 GB SSD + 1 TB HDD ● UHD (3840 x 2160) Truelife LED - Backlit Touch Display 32” LG 32UN650-W display ● 3840 x 2160 UHD, IPS, HDR10 ● Color Gamut: DCI-P3 95%, Color Calibrated ● 2 x HDMI, 1 x DisplayPort 13.3” MacBook Pro (2017) ● Ventura 13.6 ● Intel Core i7 (3.50 GHz Dual Core) ● 16 GB 2133 MHz LPDDR3 ● Intel Iris Plus Graphics 650 1536 MB ● 500 GB SSD ● Retina Display (3360 x 2100) Link to comment Share on other sites More sharing options...
garrettm30 Posted October 17, 2020 Share Posted October 17, 2020 On 10/16/2020 at 9:45 AM, Petar Petrenko said: @Patrick Connor mentioned above that 3 of my questions are covered in your video. If the forth one isn't, I would like to see how it can be done, if possible. I’m a little behind on the discussion, but as I enjoyed making the first video, I decided to make a second video to address this last point from your request: using find and replace for formatting and text styles. This video has basically two parts: How to find and replace with formatting and combine that power with regular expressions (the first 13.5 minutes), A demonstration from a portion of a real document where careful use of those principles helped save many hours of manual work (the last 30 minutes). Some people may only want to watch just the first portion to save time, as the second, longer portion is an extended example. But if this interests you, then you may want to give it a watch. I use nothing more than find and replace with regex to restore the formatting of a complex page starting from raw text. One of the expressions I build is fairly complex, and I demonstrate the process of building and testing it until it is ready to use in Publisher. Regex with formatting.mp4 thomaso, Petar Petrenko and dominik 1 2 Quote Link to comment Share on other sites More sharing options...
garrettm30 Posted October 17, 2020 Share Posted October 17, 2020 On 10/16/2020 at 12:09 PM, Petar Petrenko said: I would also like to know how to add extra space after punctuation marks but avoiding formated numbers like: 1.234,23. Why? There are cases when the customer didn't enter space after fullstop (comma, semicollon...) and now we have 2 words joined into one with punctuation mark in between. Also, is it possible to combine multiple RegEx into one? Here is a comprehensive pattern that I recommend. Although it is harder to read than what was helpfully suggested before, it has the advantage that it can work with non-Latin letters and that it can add spaces when a word next to a number is missing a space: (?<=[^\W\d])[\.,;:](?=[^\W\d])|(?<=[^\W])[\.,;:](?=[^\W\d])|(?<=[^\W\d])[\.,;:](?=[^\W]) Here is a video explanation. I did make an error in the video: I forgot that in some flavors of regex you can select letters but not numbers with [[:alpha:]] (and Publisher does support it), but what I used used [^\W\d] (which means any character that is not a non-word character or a number) is still shorter. missing_spaces_after_punctuation.mp4 P.S. Please forgive my attempt to say your name as the English “Peter.” dominik and Petar Petrenko 1 1 Quote Link to comment Share on other sites More sharing options...
Petar Petrenko Posted October 18, 2020 Author Share Posted October 18, 2020 9 hours ago, garrettm30 said: I’m a little behind on the discussion, but as I enjoyed making the first video, I decided to make a second video to address this last point from your request: using find and replace for formatting and text styles. This video has basically two parts: How to find and replace with formatting and combine that power with regular expressions (the first 13.5 minutes), A demonstration from a portion of a real document where careful use of those principles helped save many hours of manual work (the last 30 minutes). Some people may only want to watch just the first portion to save time, as the second, longer portion is an extended example. But if this interests you, then you may want to give it a watch. I use nothing more than find and replace with regex to restore the formatting of a complex page starting from raw text. One of the expressions I build is fairly complex, and I demonstrate the process of building and testing it until it is ready to use in Publisher. Thank you very much @garrettm30 for your videos and comments. There are really very helpful and time saving. From now on, my work will be nothing but a joy. 8 hours ago, garrettm30 said: P.S. Please forgive my attempt to say your name as the English “Peter.” You can call me as you like. It's the person that matters, not the name. Old Bruce 1 Quote All the latest releases of Designer, Photo and Publisher (retail and beta) on MacOS and Windows. 15” Dell Inspiron 7559 i7 ● Windows 10 x64 Pro ● Intel Core i7-6700HQ (3.50 GHz, 6M) ● 16 GB Dual Channel DDR3L 1600 MHz (8GBx2) ● NVIDIA GeForce GTX 960M 4 GB GDDR5 ● 500 GB SSD + 1 TB HDD ● UHD (3840 x 2160) Truelife LED - Backlit Touch Display 32” LG 32UN650-W display ● 3840 x 2160 UHD, IPS, HDR10 ● Color Gamut: DCI-P3 95%, Color Calibrated ● 2 x HDMI, 1 x DisplayPort 13.3” MacBook Pro (2017) ● Ventura 13.6 ● Intel Core i7 (3.50 GHz Dual Core) ● 16 GB 2133 MHz LPDDR3 ● Intel Iris Plus Graphics 650 1536 MB ● 500 GB SSD ● Retina Display (3360 x 2100) Link to comment Share on other sites More sharing options...
dominik Posted October 18, 2020 Share Posted October 18, 2020 9 hours ago, garrettm30 said: (?<=[^\W\d])[\.,;:](?=[^\W\d])|(?<=[^\W])[\.,;:](?=[^\W\d])|(?<=[^\W\d])[\.,;:](?=[^\W]) I very much appreciate your time and effort to provide these explanations and the videos. Thank you! The quote above perhaps illustrates why I get overwhelmed by regular expressions 😉 But I will give it another try. d. Quote Affinity Suite on Windows (V2) and iPad (V2). Beta testing when available. Windows 11 64-bit - Core i7 - 16GB - Intel HD Graphics 4600 & NVIDIA GeForce GTX 960M iPad pro 9.7" + Apple Pencil Link to comment Share on other sites More sharing options...
Petar Petrenko Posted October 18, 2020 Author Share Posted October 18, 2020 On 10/17/2020 at 11:06 PM, garrettm30 said: I’m a little behind on the discussion, but as I enjoyed making the first video, I decided to make a second video to address this last point from your request: using find and replace for formatting and text styles. This video has basically two parts: Actually, I am rather familiar with F/R wirh formating. I do this almost every day, as I said somewhere above. I already have pre-build text styles in Publisher and InDesign that come up with every new document for time saving purposes. What annoys me is that Paragraph styles reset local character formatings. I don't know how to say, but it is bug/error (sorry I can't find an appropriate word) that goes from the very start in Quark and InDesign and is accepted in Affinity [By Design]. If you guys -- Affinity Team -- are willing to fix it, Publisher will become extremly powerful app. Here is an image from the thread "Text import pannel" I started on Deceber 8, 2019. If you apply numbers 13, 14 and 15 to work "on the fly", to correct mistakes while typing (beside when placing text) as Word has, all Publisher documents will be (almost) error-proof. Quote All the latest releases of Designer, Photo and Publisher (retail and beta) on MacOS and Windows. 15” Dell Inspiron 7559 i7 ● Windows 10 x64 Pro ● Intel Core i7-6700HQ (3.50 GHz, 6M) ● 16 GB Dual Channel DDR3L 1600 MHz (8GBx2) ● NVIDIA GeForce GTX 960M 4 GB GDDR5 ● 500 GB SSD + 1 TB HDD ● UHD (3840 x 2160) Truelife LED - Backlit Touch Display 32” LG 32UN650-W display ● 3840 x 2160 UHD, IPS, HDR10 ● Color Gamut: DCI-P3 95%, Color Calibrated ● 2 x HDMI, 1 x DisplayPort 13.3” MacBook Pro (2017) ● Ventura 13.6 ● Intel Core i7 (3.50 GHz Dual Core) ● 16 GB 2133 MHz LPDDR3 ● Intel Iris Plus Graphics 650 1536 MB ● 500 GB SSD ● Retina Display (3360 x 2100) Link to comment Share on other sites More sharing options...
Nin Posted April 23, 2022 Share Posted April 23, 2022 Find words that must be changed to italics In Affinity Publisher (?:\_(\s*\w*|\s*\w*\s*\w*|\s*\w*\s*\w*\s*\w*)\_) Replace field: $1 and italic character style formatting Note: This finds _word_ and _Two words_ and _all Three words_ Hi! My name is _Melissa Jane Leavitt_ and I live in _Victoria_, _British Columbia_. Changes to: Hi! My name is Melissa Jane Leavitt and I live in Victoria, British Columbia. This is very handy, but is there a better (shorter? Inclusive to more than 3 words in a sentence?) to write this code? I'm stumped! Thank you so much in advance, Nin Quote Link to comment Share on other sites More sharing options...
Petar Petrenko Posted April 24, 2022 Author Share Posted April 24, 2022 Try this: (?<= \_).+?(?=\_[ .,]) * EDITED * NOTE: There is a space character after the first = and after [. Quote All the latest releases of Designer, Photo and Publisher (retail and beta) on MacOS and Windows. 15” Dell Inspiron 7559 i7 ● Windows 10 x64 Pro ● Intel Core i7-6700HQ (3.50 GHz, 6M) ● 16 GB Dual Channel DDR3L 1600 MHz (8GBx2) ● NVIDIA GeForce GTX 960M 4 GB GDDR5 ● 500 GB SSD + 1 TB HDD ● UHD (3840 x 2160) Truelife LED - Backlit Touch Display 32” LG 32UN650-W display ● 3840 x 2160 UHD, IPS, HDR10 ● Color Gamut: DCI-P3 95%, Color Calibrated ● 2 x HDMI, 1 x DisplayPort 13.3” MacBook Pro (2017) ● Ventura 13.6 ● Intel Core i7 (3.50 GHz Dual Core) ● 16 GB 2133 MHz LPDDR3 ● Intel Iris Plus Graphics 650 1536 MB ● 500 GB SSD ● Retina Display (3360 x 2100) Link to comment Share on other sites More sharing options...
walt.farrell Posted April 24, 2022 Share Posted April 24, 2022 2 hours ago, NNN said: (?<= \_).+?(?=\_[ .,]) NOTE: There is a space character between = and \ and after the open bracket. You have a space after the first =, but not after the second one. Petar Petrenko 1 Quote -- 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 17.6.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.6.1 Link to comment Share on other sites More sharing options...
Old Bruce Posted April 24, 2022 Share Posted April 24, 2022 14 hours ago, Nin said: Find words that must be changed to italics In Affinity Publisher If you have the underscore as the delimiter for start end of italics then this works for me. _(.+?)_ Petar Petrenko and walt.farrell 2 Quote Mac Pro (Late 2013) Mac OS 12.7.6 Affinity Designer 2.5.5 | Affinity Photo 2.5.5 | Affinity Publisher 2.5.5 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that. 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.