sometimes people say that every time they need to use regex, they have to relearn how regex works. i actually don't have that issue, i have a fairly solid theoretical base for how the simple regex (the kind of stuff i might need to bust out on a whim) gets put together
the problem is that theory is different from practice and the time it takes me to figure out why something that Should work Doesn't is usually longer than just not using regex
i have a file where a bunch of lines have nothing but whitespace on them and i want to keep those lines there but just make them like \n\n, no spaces or tabs on the empty line
sed -i 's/^\s+$//g' input_file
this should work, right? like
"look for the beginning of a line, followed by one or more whitespace characters, followed by the end of a line. replace it with nothing. g flag means do it for every match, not just the first"
but it doesn't modify the file at all
@monorail I think some regex implementations work linewise