Hello, @dr-ramaanand, @coises and All,
I tried to simplify the @coises search regex and I ended up with this search regex :
(?s-i)(<(.+?)[> ].*?(?:/>|</\2>))(*SKIP)(*F)|(?-s).+\R
So, given your INPUT text :
<html lang="en"> <head> <meta http-equiv="Content- Type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <META name="viewport" content="width=device-width, initial-scale=1" /> <h1>BOTHROPS</h1> <p style="color: black; font-family: Verdana,sans-serif; font-size: 18px; font-style: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; display: inline ! important; float: none;">BOTHROPS LANCEOLATUS uses [Both-l uses]</p> Haemor- rhages- dark Fear- of death E-mail us <h6>Remedies A- Z</h6> <ul> Some- list- here Dunking- donuts Seventytwo- houris </ul> <style type="text/css"> @media (min- width: 1281px) { .left { width: 180px; border-width:1px; border-style:solid; border-color:lightblue; padding-top:10px; } .right { width: 560px; border- width:1px; border- style:solid; border- color:lightblue; margin- top:0px; } } </style> <script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en'}, 'google- translate- element'); } </script>This regex just matches the three consecutive lines, below :
Haemor- rhages- dark Fear- of death E-mail usNote that I deliberately added an other string r-, followed with a space character, for tests !
Thus, the following regex S/R :
SEARCH (?s-i)(<(.+?)[> ].*?(?:/>|</\2>))(*SKIP)(*F)|(?<=\w)-(?=\x20)
REPLACE \x20-
Will replace, in these three lines ONLY, any string letter-, followed with a space char, with the string letter - and a space char
Best Regards,
guy038