I am using sed. I was using a regex that was correct as far as I could see, but sed did not do anything. Turns out that I was using \s+
which sed can not understand, and when I switched to [ ]+
it worked.
So to sum up, I made a regex which for it to work I had to escape almost everything and remove the \s
for whitespace. Seems that there is a mode to avoid all these which is -r
So I wanted to ask:
- Why isn't
-r
the default mode for sed? Why did I have to go to so much trouble to escape everything? man
says that there is the option--posix
and that "POSIX.2 BREs should be supported" What does this refer to? NFA/DFA mode?
\s+
use[[:space:]][:space:]]*
in BRE and the same or[[:space:]]+
in ERE.