Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Might be a use case for The Greatest Regex Trick Ever: 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).



Except 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).




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: