|  04-24-2015, 03:04 PM | #1 | 
| Member            Posts: 15 Karma: 12678 Join Date: Apr 2013 Device: none | 
				
				search and remove two spaces
			 
			
			I want to remove instances of two spaces in a book I am editing. If I just seach for "  " (two spaces) I get a lot of hits in parts of the book that are not book content - like css code. What search term can I use to find two spaces in only text of the book? | 
|   |   | 
|  04-24-2015, 03:20 PM | #2 | 
| Ex-Helpdesk Junkie            Posts: 19,421 Karma: 85400180 Join Date: Nov 2012 Location: The Beaten Path, USA, Roundworld, This Side of Infinity Device: Kindle Touch fw5.3.7 (Wifi only) | 
			
			If you have CSS in the HTML files, move it to a stylesheet. The search will only check HTML files (there are a few filters there). Aside from that... it really, truly doesn't matter if you remove spaces from the stylesheets. If you really want, replace everything and then use Beautify to fix the indentation. Searching for spaces only in the HTML is too complex to be done with a trivial regex, you need to use specialized tools. For example, BeautifulSoup in python. Tools that were written to parse HTML, whereas regex is designed to parse text strings and has no idea what is in them. | 
|   |   | 
| Advert | |
|  | 
|  04-24-2015, 03:22 PM | #3 | |
| Well trained by Cats            Posts: 31,249 Karma: 61360164 Join Date: Aug 2009 Location: The Central Coast of California Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A | Quote: 
 REGEX Code: ([(\w)\s{2,}(\w)Code: \1\2  you might want 1 after the \1  most render engines collapse multiple consecutive spaces anyway, so except for file size growth... why bother EXCEPTION: inside a <Pre tag | |
|   |   | 
|  04-24-2015, 03:23 PM | #4 | 
| Well trained by Cats            Posts: 31,249 Karma: 61360164 Join Date: Aug 2009 Location: The Central Coast of California Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A | 
			
			Ninja'd by eschwartz
		 | 
|   |   | 
|  | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| CSS to indent paragraphs and remove spaces | Alda | Sigil | 7 | 06-20-2014 05:36 AM | 
| How to remove blank spaces? | Mamaijee | Conversion | 2 | 04-09-2013 11:20 AM | 
| Remove Double Spaces | PortMan | Calibre | 20 | 05-13-2012 11:43 AM | 
| How can I remove spaces from folder and file names? | jusmee | Calibre | 1 | 11-06-2009 10:36 PM | 
| Anyway to remove paragraph spaces in pdb files? | twister | Other formats | 3 | 03-12-2009 09:36 PM |