I'm trying to modify a markdown file. In a file, there are many links like this one.
[string one](/stringtwo/#stringthree)
I'd like to change these to the following:
[string one](stringtwo.html#stringthree)
Remove slashes and add .html
.
I tried the following:
sed -i 's/](\(\/.*\)#/](\1.html#/g' file
But it returns [global configuration](/config/.html#globals)
. It doesn't remove slashes.
How can I achieve this using bash
or sed
?
Asked by shin
(759 rep)
Nov 18, 2022, 03:48 AM
Last activity: Nov 18, 2022, 05:21 PM
Last activity: Nov 18, 2022, 05:21 PM