View Single Post
Old 04-17-2022, 02:15 PM   #12
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,933
Karma: 6361444
Join Date: Nov 2009
Device: many
You do not need actual regex "function replace" to handle what you wanted but you could use it.

If you use just normal Sigil regex find replace, then something like the following should handle it:

Find: <div\s*xml:lang=\"es\-MX\">\s*<div>(\s*.*)</div>\s*</div>

Replace: <blockquote>\1</blockquote>

And make sure you have Dot All and Minimal Match options checked.

If you wanted to use the function replace capability then using the same Find value and flags, and then in the replace function you could use a xhtml parser to parse the captured snippet and change it to whatever you want. That is the power of function replacement.
KevinH is offline   Reply With Quote