|
|
#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! |
|
|
|
|
|
#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. |
|
|
|
|
|
#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.
|
|
|
|
|
|
#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..
|
|
|
|
|
|
#5 |
|
Enthusiast
![]() Posts: 41
Karma: 10
Join Date: Mar 2008
Device: Sony PRS-T1
|
Ooh this is good. Great thanks !
|
|
|
|
|
|
#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) |
|
|
|
|
|
#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
|
|
|
|
|
|
#8 |
|
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,571
Karma: 20150435
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.
|
|
|
|
|
|
#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
|
|
|
|
|
|
#10 |
|
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,571
Karma: 20150435
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Hmm... maybe this:
\w’\W |
|
|
|
|
|
#11 |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,270
Karma: 61916422
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 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 |