View Single Post
Old 10-18-2021, 06:44 AM   #38
lomkiri
Groupie
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
Posts: 172
Karma: 1497966
Join Date: Jul 2021
Device: N/A
Quote:
Originally Posted by davidfor View Post
For both, you have to run them multiple times. If you do "Replace all", it only makes one change in each blockquote.
It is possible to do everything on one pass, with replace all, using a regex-function
Select the mode "regex-function"

Your "find" field is :
(<blockquote class="email">)(.*?)(</blockquote>)

Create the regex-function with this code:
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):  
    inside_block = match.group(2).replace(
                '<p class="text"',
                '<p class="newtext"')
    return match.group(1) + inside_block + match.group(3)
Obviously, you have to replace "text" and "newtext" with the names you need.
Be careful, there is a simple quote after the double quote in "text"' and newtext"', it is mandatory to keep it.

Then, you can go to "replace all"
lomkiri is offline   Reply With Quote