regex confusion

John Hunter jdhunter at ace.bsd.uchicago.edu
Tue Dec 9 14:34:32 EST 2003


>>>>> "Xavier" == Xavier Martinez <xavim at fqingenieria.es> writes:

    Xavier> Depending on what you are up to, it would also be wise to
    Xavier> consider if it is possible to do it using string methods.
    Xavier> They are quite easier to handle *and debug*.

Yes, I am a firm believer in Jamie Zawinski's adage:

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

It's just that I use them so infrequently now in favor of string
methods that I have become rusty.  Hence my forgetting about DOTALL.

    Xavier> If you need to do extensive text processing in Python,
    Xavier> there is a nice book by David Mertz, which discusses the
    Xavier> issue (from simple string methods up to regexes and 
    Xavier> parsers) at: http://gnosis.cx/TPiP/

Own it.

Thanks for the help,
JDH





More information about the Python-list mailing list