View Single Post
Old 07-14-2024, 06:59 AM   #4
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,363
Karma: 20212733
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
You can use a negative look ahead

Here is a PCRE regex cheatsheat that may help.

So a find of a punctuation symbol [:punct:] followed by the negative lookahead (?! ) should find punctuation not followed by a space. Unfortunately, it would also find any punctuation with no following space at the beginning of the word…. So you might want to add a negative look behind to make sure there is no preceding space as well (?<! )

Find: (?<! )([:punct:]+?)(?! )
Replace: ‘\1 ‘ (a space after the 1 with no quotes)

Warning: I reserve the right to be wrong. I haven’t tested this and am writing from my phone in a post-surgery drug-induced euphoria…:eek: TEST THOUROUGHLY and save often. Sigil has some awesome new features that can help with making save points and seeing what changes will be made before you commit.

Also, I’m quite sure there are other ways of doing this; maybe even more elegant.

Last edited by theducks; 07-14-2024 at 02:00 PM. Reason: turned off smilies
Turtle91 is offline   Reply With Quote