regex recipies and notes
- Negative regex matching
grep return only the section that match, using perl mode and lookback
echo "123 foo YEA bar ok" > /tmp/test.txt $ grep -oP '(?<=foo )\w+(?= bar)' test.txt YEA
...
grep return only the section that match, using perl mode and lookback
echo "123 foo YEA bar ok" > /tmp/test.txt $ grep -oP '(?<=foo )\w+(?= bar)' test.txt YEA
...
regex (last edited 2019-01-29 11:38:14 by PieterSmit)