Thread: Regex examples
View Single Post
Old 07-19-2019, 04:19 PM   #586
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,745
Karma: 24032915
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Vroni View Post
i've a rather long regex having more then 9 groups. How do i refer to group number 10?
Sigil uses the PCRE library, which supports named subpatterns.

For example, if your text contains:

Code:
123456789ABCDEF
and you search for:

Code:
(.)(.)(.)(.)(.)(.)(.)(.)(.)(?<a>.)(?<b>.)(?<c>.)(?<d>.)(?<e>.)(?<f>.)
and replace it with:

Code:
\g{f}\g{e}\g{d}\g{c}\g{b}\g{a}
you'll end up with:

Code:
FEDCBA
Doitsu is offline   Reply With Quote