Why did Quora choose Python for its development?
Gregory Ewing
greg.ewing at canterbury.ac.nz
Thu May 26 23:48:36 EDT 2011
John Bokma wrote:
> A Perl programmer will call this line noise:
>
> double_word_re = re.compile(r"\b(?P<word>\w+)\s+(?P=word)(?!\w)",
> re.IGNORECASE)
> for match in double_word_re.finditer(text):
> print ("{0} is duplicated".format(match.group("word"))
Actually, Python programmers would tend to call the RE part
of that line noise, too.
It's for that reason that we tend to avoid using REs when
possible, reaching for them only as a tool of last resort.
--
Greg
More information about the Python-list
mailing list