[Tutor] re versus regex

Tim Peters tim_one@email.msn.com
Mon, 23 Aug 1999 01:58:27 -0400


[Deirdre Saoirse]
> I knew regex was quasi-deprecated, but I didn't know why. I find re
> harder to use for REALLY simple tasks.

Alas, the same problem is at the root of both:  the regex interface wasn't
thread-safe.  Introducing a separate "match object" makes re thread-safe, but
the extra object also means more teensy steps are required to get a really
simple task done.  regex is wholly deprecated (lack of thread safety was a bad
design error); re partly makes up for it by offering many more regular
expression features.

otoh-whenever-you-can-use-a-string-method-go-for-it-ly y'rs  - tim