sometimes thinking in reverse is the best. i was trying to figure out someway to get regex to remove a bunch of information in parentheses in a text file and because there were several on each line i was getting hung up, since regex is greedy and would eat everything from the first open paren to the last closed. solution: look for everything that's not a closed paren, i.e. `sed 's|([^)]*)|d'`

ԜаӀtеr Ⅼарсһуnѕkі

um, ok, i lied a little. that's what i get for changing things after the fact. `d` deletes lines in `sed`, so what i meant was `sed 's|([^)]*)||g'` so it's just replacing the match with nothing and making the change globally.

Sign in to participate in the conversation mastodon

A generalistic Mastodon instance hosted in France, open to all and available since the 9 April 2017. Learn about the instance information and guidelines.