[Spambayes-checkins] spambayes/spambayes message.py, 1.15, 1.16

Tim Stone - Four Stones Expressions tim at fourstonesExpressions.com
Mon Apr 21 19:24:22 EDT 2003

4/21/2003 5:30:34 PM, Tim Peters <tim.one at comcast.net> wrote:

>>>          """
>>>!         return re.sub(r'\r\n|\r|\n', '\r\n', data)
>[Tim Stone]
>> I think this one is even too complex.  '\r\n?|\n' does the same
>> thing... ;)
>That's one I suggested.  Another was
>    \r\n|[\r\n]

Surprisingly, my cursory benchmark scores this one about 20% slower than the 
others that we've bandied about...

>which also only needs to process two alternatives to find the lone-\n case
>(character classes are faster than alternation in Python regexps).

Yes, and the first alternative is still a useless match... can't we get rid of 
that somehow?


c'est moi - TimS

There are 10 kinds of people in the world:
  those who understand binary,
  and those who don't.

More information about the Spambayes-checkins mailing list