5 ms·
Regular expressions are useful, but on a much smaller set of problems than people typically use them for. For example Chrome's script skipper in the debug tool
by mattmanser 13y ago
Regular expressions are useful, but on a much smaller set of problems than people typically use them for.
For example Chrome's script skipper in the debug tools completely unnecessarily uses regexes rather than a simple list of 'contains'.
It's definitely one of the worst "everything's a nail" hammers a lot of programmers wield. And quite often they've been holding it upside down for years without even realizing it.
- SamReidHughes 13y ago> For example Chrome's script skipper in the debug tools completely unnecessarily uses regexes rather than a simple list of 'contains'. That is your example of overkill? More like, exactly the sort of scenario where you'd want to be able to specify a regexp.
- psquid 13y agoAnother situation where regexes are possibly abused - syntax highlighting. Yes, there are a lot of languages where you can sanely highlight /most/ code with regexes, but there's a non-zero number where you need a little more context, such as that provided by an AST (which would also help with autocompletion anyway if the highlighting is being done in the context of an editor).
- dllthomas 13y agoI'm consistently infuriated every time a search box in a GUI lacks regex support (which is very nearly all of the time).