Thread: Regex examples
View Single Post
Old 05-27-2014, 06:11 PM   #360
mzmm
Groupie
mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.mzmm has not lost his or her sense of wonder.
 
mzmm's Avatar
 
Posts: 171
Karma: 86271
Join Date: Feb 2012
Device: iPad, Kindle Touch, Sony PRS-T1
Quote:
Originally Posted by brunello View Post
1) Can I replace all the broken words (for example: hou-se), except for a list of words to ignore (for example: hang-up)?
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.

Quote:
Originally Posted by brunello View Post
2) How can I highlight only the last word of a paragraph?
I tried with "\ s \ w +. </ p>" but unfortunately does not see special characters, such as "à" or "»"
this should work for #2:
Code:
(?<=\s)[^\s<]+(?=</p>)
it's looking for:

one or more of anything that is not a space or a <
[^\s<]+

which is preceded by a space
(?<=\s)

and which is followed by a </p>
(?=</p>)

hope that helps!

Last edited by mzmm; 05-27-2014 at 06:31 PM.
mzmm is offline   Reply With Quote