I'm looking to match all less than ('<') or greater than ('>') signs in a file using sed. I only want to match the single character
My goal is to replace them with ' <'
and '> '
(ensure they have white space around them so I can parse them easier) respectively.
For example, it would match:
(without space within the tags)
< p >Hey this is a paragraph.< /p >< p >And here is another.< /p >
.. and turn it into (note the spaces)
< p > Hey this is a paragraph. < /p > < p > And here is another. < /p >
Here's what my initial (wrong) guess was:
sed 's/<{1}|>{1}/ <> /' ...
It matches the whole word/line, which is not desired, and it also does not replace correctly.
Anyways, any help would be appreciated! Thanks!