Re: [Tutor] Regular Expressions: escaping in character classes/character sets

2008-07-07 Thread Kent Johnson
On Mon, Jul 7, 2008 at 1:44 AM, Josh Rosen <[EMAIL PROTECTED]> wrote: > I was browsing through the source code of Django when I found the following > regular expression: > > tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]') > > Shouldn't this be > functionally equivalent to the much more readable

[Tutor] Regular Expressions: escaping in character classes/character sets

2008-07-06 Thread Josh Rosen
I was browsing through the source code of Django when I found the following regular expression: tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]') As it turns out, this line from the message module in the Python standard library's email module. It seems to be used to determine if an ema