Which regex syntax mode?

Tim Hammerquist tim at degree.ath.cx
Wed Sep 20 19:57:11 CEST 2000


Alex Martelli <aleaxit at yahoo.com> wrote:
> "Tim Hammerquist" <tim at degree.ath.cx> wrote:
> > Thank you.  I'm reading O'Reilly's Programming Python, based on Python
> > 1.3, so it only mentions regex and regsub.  I'm glad I asked.  =)
> 
> FYI: I tried that book first, and it put me off Python for a year.

I'm enjoying Prog. Python.  It's actually the Camel 2nd edition that put
me off Perl for 2 months.  After those 2 months I was able to accept
Perl for Perl and not try to make it into something else.  I wouldn't
change Python a bit, though.  I like the free-form of Perl syntax, but
Python's indent-based code grouping is a luxury I never knew I could
have.  =)

> Yep, but nothing is lost in having them packaged as objects -- on the

Very true. You simply lose some idioms, but that's not necessarily bad,
as I'm _sure_ someone will point out...  ;)

> contrary.  It enables you to write a function that will accept compiled
> regular-expression objects *OR ANYTHING ELSE SOMEHOW IMPLEMENTING THE
> .search METHOD IN A CALL-COMPATIBLE WAY*, e.g. using such objects to
> "filter" incoming lines-of-text for acceptability/interest, and gain all
> the benefits of polymorphism.  _Very_ handy...

Very true.  The first thing about Python that I really liked is a real
ability to create custom data structures and classes that can imitate
and be used as inherent objects.  _VERY_ hand indeed.

-- 
-Tim Hammerquist <timmy at cpan.org>

Legend -- a lie that has attained the dignity of age.
	-- H. L. Mencken



More information about the Python-list mailing list