View Single Post
Old 01-20-2024, 01:36 PM   #15
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,597
Karma: 23164939
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by famfam View Post
I am trying to solve the problem of double words with Sigil:
In Sigil, the following simple regular expression should find repeated words, if they're separated by one or more spaces:

(*UCP)\b(\p{L}+)\s+\1\b

To replace them with a single word simply use \1 as the replacement expression.

For example, this'll replace:

Code:
eine  eine üble   üble heiße  heiße Soße    Soße.
with

Code:
eine üble heiße Soße.
Obviously, the regular expression will not work if the duplicated word is wrapped in tags. For example:

Code:
eine  <span>eine</span> üble   <span>üble</span> heiße  <span>heiße</span> Soße    Soße.
Doitsu is offline   Reply With Quote