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

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 08-10-2012, 06:54 PM   #1
essayhead
Junior Member
essayhead began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Aug 2012
Device: Nook
Regex Find and Replace - Spaces

Hi all, I have a quick Regex question. I converted a crappy PDF into HTML and then into EPUB. So I was cleaning it up in Sigil and realized that there are some issues with the text itself. There are a bunch of words that have been shoved together without any spaces, but there's generally a pattern--they show up when prepositions are in front of proper names. Namely, I can tell what most of them are by running

[a-z][A-Z]

in the Find box with Regex. Now the question is, what is the correct way for me to insert a space so that "inLondon" becomes "in London" and so on? I've been using Regex to just find them and insert the space manually, but there is a lot of them. And, yes, those errors in the original file as well. So is there a formula that I can put in the Replace box? Or is this just not possible at all? I don't know, I honestly just discovered Regex and I'm verrry slowly learning it. Any help would be greatly appreciated. Thanks!
essayhead is offline   Reply With Quote
Old 08-10-2012, 07:24 PM   #2
PeterT
Taking a break; Fed up
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 7,033
Karma: 45179649
Join Date: Nov 2007
Location: Toronto
Device: Wife: Touch, Arc, Vox Me: Nexus 7, Glo
Search for: ([a-z])([A-Z])
Replace by: \1 \2

Note the space between the \1 and the \2
PeterT is offline   Reply With Quote
Old 08-10-2012, 07:41 PM   #3
essayhead
Junior Member
essayhead began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Aug 2012
Device: Nook
Thank you so much! This also clears up something I wasn't quite understanding with another code of mine. Thanks again!
essayhead is offline   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
Sigil Wildcards/Regex Find/Replace Adman35 Sigil 7 08-16-2014 01:02 PM
Regular Expression: does not replace with spaces murphycc Conversion 3 02-11-2012 01:31 PM
RegEx: Removing Page Numbers that have Spaces captainslow Conversion 2 02-27-2011 04:14 PM
RegEx find and replace iblesq Sigil 1 01-10-2011 09:26 PM
REGEX find and replace help please potestus Sigil 13 09-18-2010 04:14 PM


All times are GMT -4. The time now is 10:46 AM.


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