The Regex Story

MRAB python at
Fri Apr 9 04:27:31 CEST 2010

Dotan Cohen wrote:
>> I would have agreed with you if someone were to make the statement
>> until a few weeks ago; somehow in the last week or so, the mood about
>> regex seems to has shifted to "regex is not suitable for anything"
>> type of mood. As soon as someone (OP or not) proposed a regex
>> solution, someone else would retort with don't use regex use
>> string-builtins or pyparsing. It appears that the group has developed
>> some sense of regexphobia; some people pushes using string builtins
>> for moderately complex requirement and suggested pyparsing for not-so
>> complex need and that keeps shrinking regex sweet spot. But that's
>> just my inherently subjective observation.
> Isn't that a core feature of a high-level language such as Python?
> Providing the tools to perform common or difficult tasks easily
> thought built in functions?
> I am hard pressed to think of a situation in which a regex is
> preferable to a built-in function.
Regexes do have their uses. It's a case of knowing when they are the
best approach and when they aren't.

More information about the Python-list mailing list