4 ms·
Without getting into CS definition of a 'regular language' and how it differs from a "regex", questions like this are amusing, because they show that people are
by niftich 10y ago
Without getting into CS definition of a 'regular language' and how it differs from a "regex", questions like this are amusing, because they show that people are in fact attracted to very-terse-string-matching-notations.
I believe regexes are a triumph of declarative (and therefore, functional) programming: tell the computer what results you want, without describing the control flow. Even though sometimes they are not the right tool for the job, the paradigm shift from declarative to imperative is often appealing enough to invite their use.