I have a sed command that is working fine, except when it comes across a newline right in the file somewhere. Here is my command:
sed -i 's,<a href="\(.*\)">\(.*\)</a>,\2 - \1,g'
Now, it works perfectly, but I just ran across this file that has the a
tag like so:
<a href="link">Click
here now</a>
Of course it didn't find this one. So I need to modify it somehow to allow for lines breaks in the search. But I have no clue how to make it allow for that unless I go over the entire file first off and remove all \n
before hand. Problem there is I loose all formatting in the file.