I want to remove the STRONG tags in a text-file.
I’m using sed 's/< strong>/>/g' for removing the STRONG tag and that works fine.
But when I want to remove the < /STRONG> tag with this sed 's/< /strong>//g'
it states the following error sed: -e expression #1, char 13: Unknown option tos’`
I believe it has to do with the < /-part but I don’t know what. Can somebody please explain me how to fix it?
The space between < and strong and others is on purpose for this question-only
Your problem is that you are using
/as a pattern/replacement separator, if you want to match/replace one (/), you must escape it (like:\/) that way, but more on that see below.sed is not an ideal tool for (X|HT)ML processing. If the tag does not span to multiple lines, it might work for you:
This replaces both
<strong>,< strong>,</strong>,< /strong>with a single>(as you had written in the question).sedcan use several pattern/replacement separators, not just/(I’m using_above.)