Thread: Regex examples
View Single Post
Old 05-28-2014, 04:41 AM   #361
brunello
Junior Member
brunello began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2014
Device: galaxy tab3 7''
Quote:
Originally Posted by mzmm View Post
not really a way to reasonably exclude words. if you're breaks are always between two letters you may as well just search for a hyphen using 'Replace/Find' in Sigil. it'd probably only take a few minutes.
1) I am using this method, but I wanted to automate the process, because using this system find over 500 results for book ... they are versions of texts from pdf to calibre.
However you are right, I do not lose more than 15 minutes per book.

Quote:
this should work for #2:
Code:
(?<=\s)[^\s<]+(?=</p>)
2) The second regex is perfect! much more general than that I did.
You can add to this macro to highlight also the beginning of the next paragraph, so you can replace and merge the two paragraphs?

After writing the last post, I made this regex:

Search:
(\w+\p{L}.\p{P}*\p{Pf}*[</span>]*[</i>]*)</p>\n*[ <p class="calibre1">]*

Replace:
\ 1

but your macro, being more generic, find more matches
thanks!
brunello is offline   Reply With Quote