Which regex syntax mode?

Alex Martelli aleaxit at yahoo.com
Fri Sep 15 06:28:01 EDT 2000


"Tim Hammerquist" <tim at degree.ath.cx> wrote in message
news:slrn8s3jqv.4e8.tim at degree.ath.cx...
> I come from Perl and was wondering with RegExp syntax mode was most like
> Perl's syntax?  It's not that I dislike Emacs-style...well, actually it
> _is_ that I dislike Emacs-style.  Is there one that's closer to Perl's?
> Or even vi-style?

    import re

gives you regular expressions very close to Perl's.  re is the bright,
shiny, new, module.  The docs say, about bad old regex (at 4.3):

"""
Obsolescence note: This module is obsolete as of Python version 1.5
"""

and continue by explaining you should use re instead.


Alex






More information about the Python-list mailing list