|
|
|
|
|
by asicsp
1364 days ago
|
|
If you'd like to learn more about such grep powers, check out my free ebook [0] What do you mean by "reverse \K"? Are you aware of lookarounds? Perhaps you meant positive lookahead? # match digits only if there is a semicolon afterwards
$ echo '12; 42,31;100' | grep -oP '\d+(?=;)'
12
31
[0] https://learnbyexample.github.io/learn_gnugrep_ripgrep/intro... |
|
Basically
would find all `hello world out there` and replace `world` to `planet`.