I have a string, lets say:
<lic><ic>This is a string</ic>, welcome to my blog.</lic>
I want to use sed to get rid of the <ic> and </ic> tags, as well as the literal tags <lic> and </lic>
What is the fastest way to do this? I’m very new to sed. How would this be done in awk?
I know awk is much better for column-like text, so I feel more inclined to learn how to use sed.
Any help is always appreciated, thanks in advance!
The
\{0,1\}is the standardsedway of writing the equivalent of?in PCRE. The regex uses%to separate bits; then looks for an<possibly followed by a slash, possibly followed by anl, followed byic>and replaces it with nothing, globally across each line of input.Some versions of
sedallow you to specify alternative systems of regexes, but this works everywhere.