Thread: Regex question
View Single Post
Old 01-02-2016, 06:10 AM   #3
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 875
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
It is possible. See here. Specifically, note: Perl String Features in Regular Expressions and Replacement Texts, although Sigil notation is a little different to Perl.

A simple example. Suppose you had the text:
Code:
<h2>chapter two</h2>
The following search and replace:
Code:
Search = <h2>(.+?)</h2>

Replace = <h2>\u\1</h2>
And the result:
Code:
<h2>Chapter one</h2>
Obviously, you can make it as simple or as complex as you like.

Hope this helps.
sherman is offline   Reply With Quote