Skip to content
Advertisement

Why Sed cannot replace lines that contains . + and *

I have a large file and some of the lines are as follows:

JavaScript

I want to replace ….+UNKNOWN part with the ...+PUNCT

To do that, I did the following:

JavaScript

However, none of the lines gone.

JavaScript

I couldn’t find my error, could you help me about ?

Advertisement

Answer

In some versions of sed, + has a special meaning, use + to match the plus literally.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement