Hello, @vasile-Caraus and All,
The general syntax of your regex is :
SEARCH (?-s)(\G|BR)((?!ER).)*?\KSR
REPLACE RR
where :
BR ( Begining Regex ) is the regex which defines the start of the defined zone, for search/replacement
ER ( Ending Regex ) is the regex which defines the end of the defined zone, for search/replacement
SR ( Search Regex ) is the regex which defines the regex to search, in any defined zone
RR ( Replace Regex ) is the regex which defines the regex replacing the search regex, in any defined zone
For instance, before the S/R, if we have :
..SR.....SR...BR......SR............SR.....ER...SR......SR...BR.......SR........ER....BR..SR......SR.....SR...ER....SR......SR..
it will give the results :
..SR.....SR...BR......RR............RR.....ER...SR......SR...BR.......RR........ER....BR..RR......RR.....RR...ER....SR......SR..
Of course, in the Vasile’s example, we have :
BR = <p class="my_class">
ER = </p>
SR =
RR = \x20
But, let’s suppose that we take :
BR = [01234]+
ER = [56789]+
SR = (?i)[a-z]+
RR = |$0|
So, assuming the text :
..SR.......SR....BR....SR....SR.......ER...SR........SR.....BR....SR.....ER..BR....SR......SR.....SR......ER....SR......SR.......
..Here.....is....111...a.....Simple...6....Example...of.....44....some...9999000...TEXT....to.....Search..7.....and.....Modify...
and the transformed regex S/R :
SEARCH (?-s)(\G|[01234]+)((?![56789]+).)*?\K(?i)[a-z]+
REPLACE |$0|
it would produce, as expected, the text :
..SR.......SR....BR....RR......RR.........ER...SR........SR.....BR....RR.......ER..BR....RR........RR.......RR........ER....SR......SR.......
..Here.....is....111...|a|.....|Simple|...6....Example...of.....44....|some|...9999000...|TEXT|....|to|.....|Search|..7.....and.....Modify...
Cheers,
guy038