Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 04-22-2014, 05:41 AM   #1
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-505
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, 06: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: 3,083
Karma: 5462767
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
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, 07:30 AM   #3
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-505
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, 07: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: 3,083
Karma: 5462767
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
Enter a space at the end of the search term..
Toxaris is offline   Reply With Quote
Old 04-22-2014, 07:39 AM   #5
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-505
Ooh this is good. Great thanks !
bremler is offline   Reply With Quote
Old 04-22-2014, 07:40 AM   #6
qsipl
Member
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: 23
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, 07:42 AM   #7
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-505
[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, 08: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: 6,244
Karma: 4801165
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, 11:37 AM   #9
bremler
Enthusiast
bremler began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-505
Jellby, what's the full syntax to enter? I'll try it out
bremler is offline   Reply With Quote
Old 04-24-2014, 01: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: 6,244
Karma: 4801165
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, 10:46 PM   #11
theducks
Grand Sorcerer
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: 15,039
Karma: 5936659
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Code:
(\w)\s
since there is always a space
replace: \1,[aspace] <just a space
theducks is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 12:36 PM.


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