View Single Post
Old 03-23-2021, 05:20 AM   #2
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,739
Karma: 24031403
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by BKh View Post
I found on line that some regex systems can use $10, $11, etc, but that doesn't seem to work either.
Sigil uses the PCRE2 engine for regex searches, which supports named subpatterns.

For example, if your book contains the string:

Code:
abcdefghijkl
you could use the following expression to capture each letter:

Find:
Code:
(?<a>a)(?<b>b)(?<c>c)(?<d>d)(?<e>e)(?<f>f)(?<g>g)(?<h>h)(?<i>i)(?<j>j)(?<attr>k)(?<l>l)
Replace:
Code:
\g{f}\g{e}\g{d}\g{c}\g{b}\g{a}\g{j}\g{l}\g{attr}
You'll end up with:

Code:
fedcbajlk

Last edited by Doitsu; 03-23-2021 at 05:24 AM.
Doitsu is offline   Reply With Quote