Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 04-22-2014, 04:41 AM   #1
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-T1
Regex help please

Hello I would appreciate some help with regex.

I'm editing a badly OCR scanned novel which often has vital punctuation missing before talking marks. Here's an example:

‘Come on darling,’ she said. ‘We’re here now.’

is missing the comma after darling.

‘Come on darling’ she said. ‘We’re here now.’

Is there a way, using regex, I could go through the entire book and do a search for any dialogue that is missing . , ; or - before the quotation marks?

Many thanks!
bremler is offline   Reply With Quote
Old 04-22-2014, 05:18 AM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Of course. You can search for: ([a-z])’

However, there might be much more punctuation missing here.
Toxaris is offline   Reply With Quote
Old 04-22-2014, 06:30 AM   #3
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-T1
Hey, thanks. Hm. This is problematic, as I get too many results. It picks up words like couldn’t, should’ve, etc. I might have to bite the bullet and do this manually.
bremler is offline   Reply With Quote
Old 04-22-2014, 06:37 AM   #4
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Enter a space at the end of the search term..
Toxaris is offline   Reply With Quote
Old 04-22-2014, 06:39 AM   #5
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-T1
Ooh this is good. Great thanks !
bremler is offline   Reply With Quote
Old 04-22-2014, 06:40 AM   #6
qsipl
Enthusiast
qsipl ought to be getting tired of karma fortunes by now.qsipl ought to be getting tired of karma fortunes by now.qsipl ought to be getting tired of karma fortunes by now.qsipl ought to be getting tired of karma fortunes by now.qsipl ought to be getting tired of karma fortunes by now.qsipl ought to be getting tired of karma fortunes by now.qsipl ought to be getting tired of karma fortunes by now.qsipl ought to be getting tired of karma fortunes by now.qsipl ought to be getting tired of karma fortunes by now.qsipl ought to be getting tired of karma fortunes by now.qsipl ought to be getting tired of karma fortunes by now.
 
Posts: 25
Karma: 412584
Join Date: Feb 2014
Device: IPAD, KF8 & Tablet
Regex help please

You can try this

[a-z])’# (# means space)
qsipl is offline   Reply With Quote
Old 04-22-2014, 06:42 AM   #7
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-T1
[a-z])’# doesn't seem to work in Sigil, but the space one does. Thanks anyway
bremler is offline   Reply With Quote
Old 04-22-2014, 07:11 AM   #8
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Does \W work? \w is supposed to mean "any character allowed in a word (letter or underscore)", and \W is the opposite.
Jellby is offline   Reply With Quote
Old 04-24-2014, 10:37 AM   #9
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-T1
Jellby, what's the full syntax to enter? I'll try it out
bremler is offline   Reply With Quote
Old 04-24-2014, 12:05 PM   #10
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Hmm... maybe this:

\w’\W
Jellby is offline   Reply With Quote
Old 04-24-2014, 09:46 PM   #11
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,792
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Code:
(\w)\s
since there is always a space
replace: \1,[aspace] <just a space
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex help paulfiera Sigil 4 06-14-2012 07:55 AM
RegEx Help ghostyjack Workshop 4 03-22-2012 09:24 AM
Regex Gunnerp245 Conversion 5 03-05-2012 04:15 PM
regex help please thevoiceofcheese Calibre 2 08-01-2011 11:27 PM
What a regex is Worldwalker Calibre 20 05-10-2010 05:51 AM


All times are GMT -4. The time now is 11:47 AM.


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