Thread: Regex examples
View Single Post
Old 09-16-2020, 06:09 AM   #661
leschek
Enthusiast
leschek began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Sep 2020
Device: Onyx Poke2
I hope this is correct topic to post to.

In my language we use one letter prepositions and conjunctions (a, i, o, u, k, s, v, z) which shouldn't be on the end of lines. Here is example from book I try to "epubize":
"spatřil člun a v tom člunu". (translation: "he saw a boat and in that boat")
What I want is to find letters "a" and "v" and replace them with no-break space to connect them to following word. I have this regex (I found somewhere)
Code:
\s([aiouksvz])\s
for searching, but it finds only the first letter and then skip the second one. I tried to change the searching direction in Sigil to "up", but it doesn't help. I guess there must be some problem with regex I'm using.

I also tried this example and again it finds only every second letter:

Code:
<p>some words a s i k v some words</p>
It seems there is some problem with space between letters. When I double it to:

Code:
<p>some words a  s  i  k  v  some words</p>
the searching works.
leschek is offline   Reply With Quote