View Single Post
Old 02-07-2019, 12:53 PM   #3
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by mavaddat View Post
I see that the Sigil Clip Editor has some basic regex [...] but I don't see any specification of the syntax for the Clip Editor. Does anyone know what the full range of regex available to the Clip Editor?
Sigil uses PCRE engine for regular expressions.

Quote:
Originally Posted by mavaddat View Post
Specifically, I am wondering if I can easily parse the selected text using regex pattern and replace it with some other text using the Clips functionality.
Yes, you can use parentheses () to capture.

Search: ([abc]+)([def]+)([hij]+)
Replace: \1\2\3

Each Regex within the parentheses becomes its own "group", which you can then replace using \1, \2, \3, [...].

acabacdhh

\U tells regex to "uppercase everything beyond this point". So let's say you only wanted to uppercase the groups 2 and 3:

Search: ([abc]+)([def]+)([hij]+)
Replace: \1\U\2\3

acabacDHH

Side Note: See "Use Parentheses for Grouping and Capturing" on Regular-Expressions.info and "Numbered Backreferences" for more information.
Tex2002ans is offline   Reply With Quote