Hello, @ramanand-jhingade, @alan-kilborn, @terry-r, @peterjones and All,
@ramanand-jhingade, sorry that my method did not work :-( I don’t understand !
It’s important to note that my method would work ONLY IF the beginning of the “canonical” line is exactly :
<link rel"canonical" href="
^
|
Beginning of line
If this line could be, for instance, any of these ones, below :
<link rel "canonical" href="
<link rel"canonical"href="
<link rel "canonical"href="
<link rel "canonical" href="
<link rel"canonical"href="
<link rel "canonical"href="
My method would not find the canonical line ! So, just tell me about it !
I even made tests with files containing a space chars in their names like This is a test.html and it did create the correct line :
<link rel"canonical" href="https://cure4incurables.in/This is a test.html" />
Of course, in this specific case, in order to get functional links, we must change any space char with the %20 syntax, thank to the S/R, below :
SEARCH (?-i)(?:href="|(?!\A)\G)(?:(?!").)*?\K\x20
REPLACE %20
Using the Regular expression search mode and ticking the Wrap around option would result, after replacement, in the functional line :
<link rel"canonical" href="https://cure4incurables.in/This%20is%20a%20test.html" />
Best Regards,
guy038