3 ms·
sorry, it is not same as `grep -iv '^c'` the `-o` option allows to output only matching portion, the regex is meant to extract all words other than those start
by asicsp 9y ago
sorry, it is not same as `grep -iv '^c'`
the `-o` option allows to output only matching portion, the regex is meant to extract all words other than those starting with 'c' or 'C'
here's hopefully better example
$ # do something with words not surround by quotes
$ echo 'I like "mango" and "guava"' | perl -pe 's/"[^"]+"(*SKIP)(*F)|\w+/\U$&/g'
I LIKE "mango" AND "guava"
- lifthrasiir 9y agoOh, you are right. I missed that all words are in the same line. That said even the original article mentions that it only moves the captured group to the entire match; I am generally in a position to avoid all uses of control verbs, especially if it only costs one or probably two lines of the additional code that I can fully control and comprehend.