04-22-2014, 04:41 AM | #1 |
Enthusiast
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! |
04-22-2014, 05:18 AM | #2 |
Wizard
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. |
04-22-2014, 06:30 AM | #3 |
Enthusiast
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.
|
04-22-2014, 06:37 AM | #4 |
Wizard
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..
|
04-22-2014, 06:39 AM | #5 |
Enthusiast
Posts: 41
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-T1
|
Ooh this is good. Great thanks !
|
04-22-2014, 06:40 AM | #6 |
Enthusiast
Posts: 25
Karma: 412584
Join Date: Feb 2014
Device: IPAD, KF8 & Tablet
|
Regex help please
You can try this
[a-z])’# (# means space) |
04-22-2014, 06:42 AM | #7 |
Enthusiast
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
|
04-22-2014, 07:11 AM | #8 |
frumious Bandersnatch
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.
|
04-24-2014, 10:37 AM | #9 |
Enthusiast
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
|
04-24-2014, 12:05 PM | #10 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Hmm... maybe this:
\w’\W |
04-24-2014, 09:46 PM | #11 |
Well trained by Cats
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 replace: \1,[aspace] <just a space |
|
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 |