This is more of a general suggestion: if you use Regular Expression, use https://regex101.com/. It provides syntax highlighting, explains the syntax and allows you to test your regexes.
Additionally, I think that sd
is way more intuitive than sed
.
https://github.com/andyholmes/valent/