[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-02-05 Thread Russ Cox
Russ Cox r...@swtch.com added the comment: Named Unicode characters eg \N{LATIN CAPITAL LETTER A} These descriptions are not as stable as, say, Unicode code point values or language names. Are you sure it is a good idea to depend on them not being adjusted in the future? It's certainly nice

[issue2650] re.escape should not escape underscore

2008-05-08 Thread Russ Cox
Russ Cox [EMAIL PROTECTED] added the comment: Lorenz's patch uses a set, not a list for special characters. Set lookup is as fast as dict lookup, but a set takes less memory because it does not have to store dummy values. More importantly, use of frozenset instead of dict makes the code

[issue2650] re.escape should not escape underscore

2008-05-08 Thread Russ Cox
Russ Cox [EMAIL PROTECTED] added the comment: You don't need to get so defensive. I did not raise a performance problem, I was simply responding to Rafael's AFAIK the lookup on dictionaries is faster than on lists comment. I did not say that you *should* rewrite your patch the way I

[issue2650] re.escape should not escape underscore

2008-05-08 Thread Russ Cox
Russ Cox [EMAIL PROTECTED] added the comment: On Thu, May 8, 2008 at 12:12 PM, Alexander Belopolsky [EMAIL PROTECTED] wrote: Alexander Belopolsky [EMAIL PROTECTED] added the comment: On Thu, May 8, 2008 at 11:45 AM, Russ Cox [EMAIL PROTECTED] wrote: .. My argument is only that Python

[issue2650] re.escape should not escape underscore

2008-04-24 Thread Russ Cox
Russ Cox [EMAIL PROTECTED] added the comment: The loop in escape should really use enumerate instead of for i in range(len(pattern)). It needs i to edit s[i]. Instead of using a loop, can't the test just use self.assertEqual(re.esacpe(same), same)? Done. Also, please add tests

[issue2636] Regexp 2.6 (modifications to current re 2.2.2)

2008-04-24 Thread Russ Cox
Changes by Russ Cox [EMAIL PROTECTED]: -- nosy: +rsc __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2636 __ ___ Python-bugs-list mailing list Unsubscribe: http

[issue2537] re.compile(r'((x|y+)*)*') should fail

2008-04-24 Thread Russ Cox
Changes by Russ Cox [EMAIL PROTECTED]: -- nosy: +rsc __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2537 __ ___ Python-bugs-list mailing list Unsubscribe: http

[issue1160] Medium size regexp crashes python

2008-04-24 Thread Russ Cox
Changes by Russ Cox [EMAIL PROTECTED]: -- nosy: +rsc __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1160 __ ___ Python-bugs-list mailing list Unsubscribe: http

[issue1662581] the re module can perform poorly: O(2**n) versus O(n**2)

2008-04-24 Thread Russ Cox
Changes by Russ Cox [EMAIL PROTECTED]: -- nosy: +rsc _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1662581 _ ___ Python-bugs-list mailing list Unsubscribe

[issue433030] SRE: Atomic Grouping (?...) is not supported

2008-04-24 Thread Russ Cox
Changes by Russ Cox [EMAIL PROTECTED]: -- nosy: +rsc Tracker [EMAIL PROTECTED] http://bugs.python.org/issue433030 ___ Python-bugs-list mailing list Unsubscribe: http

[issue1693050] \w not helpful for non-Roman scripts

2008-04-24 Thread Russ Cox
Changes by Russ Cox [EMAIL PROTECTED]: -- nosy: +rsc _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1693050 _ ___ Python-bugs-list mailing list Unsubscribe

[issue1647489] zero-length match confuses re.finditer()

2008-04-24 Thread Russ Cox
Changes by Russ Cox [EMAIL PROTECTED]: -- nosy: +rsc _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1647489 _ ___ Python-bugs-list mailing list Unsubscribe

[issue1297193] Search is to long with regex like ^(.+|dontmatch)*$

2008-04-24 Thread Russ Cox
Changes by Russ Cox [EMAIL PROTECTED]: -- nosy: +rsc _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1297193 _ ___ Python-bugs-list mailing list Unsubscribe

[issue1721518] Small case which hangs

2008-04-24 Thread Russ Cox
Changes by Russ Cox [EMAIL PROTECTED]: -- nosy: +rsc _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1721518 _ ___ Python-bugs-list mailing list Unsubscribe

[issue433024] SRE: (?flag) isn't properly scoped

2008-04-24 Thread Russ Cox
Changes by Russ Cox [EMAIL PROTECTED]: -- nosy: +rsc Tracker [EMAIL PROTECTED] http://bugs.python.org/issue433024 ___ Python-bugs-list mailing list Unsubscribe: http

[issue2650] re.escape should not escape underscore

2008-04-23 Thread Russ Cox
Changes by Russ Cox [EMAIL PROTECTED]: -- keywords: +patch Added file: http://bugs.python.org/file10080/re.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2650

[issue2650] re.escape should not escape underscore

2008-04-17 Thread Russ Cox
New submission from Russ Cox [EMAIL PROTECTED]: import re print re.escape(_) Prints \_ but should be _. This behavior differs from Perl and other systems: _ is an identifier character and as such does not need to be escaped. -- messages: 65585 nosy: rsc severity: normal status: open

[issue2650] re.escape should not escape underscore

2008-04-17 Thread Russ Cox
Changes by Russ Cox [EMAIL PROTECTED]: -- components: +Regular Expressions __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2650 __ ___ Python-bugs-list mailing list

[issue2650] re.escape should not escape underscore

2008-04-17 Thread Russ Cox
Russ Cox [EMAIL PROTECTED] added the comment: It seems that escape is pretty dumb. The documentations says that re.escape escapes all non-alphanumeric characters, and it does that faithfully. It would seem more useful to have a list of meta-characters and just escape those. This is more true