Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old Today, 06:04 AM   #1
dearleuk
Member
dearleuk began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Oct 2008
Device: sony
Help with Search Please

Long time since I posted here

Has anyone got some Regex/search that will find punctuation that hasn't got a space after

EG

‘Oh, I don’t know,’Jessie groaned

Missing space after ’ or before Jessie

What I want to find is ,’

Not followed by a space

Quite a few of them and not just speechmarks but question marls, exclamation marks. Really hard to spot

I'm using Sigil

Thank you
dearleuk is offline   Reply With Quote
Old Today, 06:24 AM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,761
Karma: 27405072
Join Date: Mar 2012
Location: Sydney Australia
Device: none
thanks

BR
BetterRed is online now   Reply With Quote
Old Today, 06:55 AM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,669
Karma: 195159104
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
\p{P}[^ ]

Or

\p{P}(?!\p{Zs})

The latter should work for any kind of space character.
DiapDealer is offline   Reply With Quote
Old Today, 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,127
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 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; Today at 02:00 PM. Reason: turned off smilies
Turtle91 is offline   Reply With Quote
Old Today, 07:00 AM   #5
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,127
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Dang it! Ninja’d TWICE!
Turtle91 is offline   Reply With Quote
Old Today, 07:09 AM   #6
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,127
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
And that should read (:punct:)

Last edited by Turtle91; Today at 07:14 AM.
Turtle91 is offline   Reply With Quote
Old Today, 07:30 AM   #7
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,127
Karma: 18727091
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Another warning…. Did I mention I’m loopy??…. This will also match words with contractions (eg I’m they’re we’ve) so you may want to dumb it down and just look for the specific occurrences one type at a time.

Code:
Find: ,’(?! )
Replace: ,’    (With a following space)
Turtle91 is offline   Reply With Quote
Old Today, 07:48 AM   #8
dearleuk
Member
dearleuk began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Oct 2008
Device: sony
Quote:
Originally Posted by Turtle91 View Post
Another warning…. Did I mention I’m loopy??…. This will also match words with contractions (eg I’m they’re we’ve) so you may want to dumb it down and just look for the specific occurrences one type at a time.

Code:
Find: ,’(?! )
Replace: ,’    (With a following space)
That did the trick, thank you both

Get well soon Turtle91

Last edited by dearleuk; Today at 09:01 AM.
dearleuk is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New Feature? Embed search term as a tag into Search Results with one click? mikhail_fil Library Management 1 04-02-2022 10:18 PM
Removing Search from Search Bar Not Bringing You back To author menu chantw0968 Calibre 7 11-09-2017 07:51 AM
Regex in search problems (NOT Search&Replace; the search bar) lairdb Calibre 3 03-15-2017 07:10 PM
Regex Search doesn't search all files in Edit Book GregTheGrate Editor 8 11-08-2016 12:47 AM
Google Book Search to search full-text books online Bob Russell Deals and Resources (No Self-Promotion or Affiliate Links) 1 08-19-2006 12:13 PM


All times are GMT -4. The time now is 06:25 PM.


MobileRead.com is a privately owned, operated and funded community.