Thread: Regex Question
View Single Post
Old 01-26-2011, 07:19 AM   #3
Archon
Zealot
Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!Archon , Klaatu Barada Niktu!
 
Archon's Avatar
 
Posts: 110
Karma: 5176
Join Date: Dec 2010
Device: Mac OSX, iPad, iPod, & Nook
Sorry, I should clarify.

The file I am working on is an rtf file. So, the replacement example you gave me I believe is HTML?

Also as I tried to explain in my original post the words for replacement fall into two categories. Those with spaces after the word and those with other characters. I am trying to write an expression that would work for both categories in one pass.

Would your replacement example work for both categories in HTML in one pass? If that is true I can switch to editing in HTML if it is more forgiving.

From my experiments, your search suggestion works great and can be used for one category or the other in one pass. I know I can just make two passes but I was curious if there might be a better way.

I am doing this with an regex enabled text editor for the moment to actually learn regex before I have Calibre do it for me and to better understand what exactly Calibre is doing under the hood so I can tweak it if I have to before cutting Calibre loose on multiple documents.

Thanks for the help.
Archon
Archon is offline   Reply With Quote