I have a string that looks something like this.
<tag-name i-am-an-attribute="123" and-me-too="321">
All I want to do is replace the dashes into an underscore, but the tag-name should remain like it is.
Hope there are some regex guru's who can help me out.
[solution]
In case someone needs this.
I ended up with a perl oneliner command
echo '<tag-name i-am-an-attribute="123" and-me-too="321">' | perl -pe 's/( \K[^*"]*)-/$1_/g;' | perl -pe 's/ / /g;'
results in
<tag-name i_am_an_attribute="123" and_me_too="321">