4 ms·
Might be a use case for The Greatest Regex Trick Ever: http://www.rexegg.com/regex-best-trick.html http://www.rexegg.com/regex-best-trick.html (which boils dow
by jodrellblank 6y ago
Might be a use case for The Greatest Regex Trick Ever: http://www.rexegg.com/regex-best-trick.html http://www.rexegg.com/regex-best-trick.html
(which boils down to "trump|(what you want)" and then check the capture group to see if you got what you want).
- kleiba 6y agoExcept not all applications of regular expressions allow for that trick to be used. Case in point: grep (which of course has the -v option which together with pipes does the whole negative match thing much more neatly anyway).