Regex on a Dictionary

Steven D'Aprano steve+comp.lang.python at pearwood.info
Tue Feb 13 12:16:20 EST 2018


On Tue, 13 Feb 2018 13:53:04 +0000, Mark Lawrence wrote:

> Was the string methods solution that I gave a week or so ago so bad that
> you still think that you need a regex to solve this?

Sometimes regexes are needed, but often Jamie Zawinski is right:

    Some people, when confronted with a problem, think "I know, 
    I'll use regular expressions." Now they have two problems.


Using the nuclear-powered bulldozer of regular expressions to crack the 
peanut of a simple fixed-string matching problem is rarely a good idea.



-- 
Steve




More information about the Python-list mailing list