View Single Post
Old 12-01-2011, 12:34 PM   #1
ElMiko
Evangelist
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 471
Karma: 65460
Join Date: Jun 2011
Device: Kindle
Match a string while ignoring some character in that string?

So...

I'm cleanining up a book which has added title headings to the body of the text so that it looks like this:

Code:
<p>We were walking down the street when</p>

<p>THIS IS THE BOOK TITLE</p>

<p>we saw a squirrel sleeping in the middle of the road.</p>
Given the number of words in the title, and the fact that it is in all caps, this would generally be an easy fix. Unfortunately, the title has spaces thrown into it randomly so that it will look like:

Code:
THI S IS THE B OOK TITLE
or
THIS IS THE BO OK TI TLE
or
THIS I S THE BOOK TITLE
or
THIS IS THE B O O K TITLE
....etc
Is there any way to get match by matching the letters in the string while ignoring the spaces? And furthermore is it possible if the title is a mix of uppercase and lowercase?

Last edited by ElMiko; 12-01-2011 at 01:01 PM.
ElMiko is offline   Reply With Quote