Quote:
Originally Posted by davidfor
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"