re Questions

Roy Smith roy at panix.com
Sun Jan 26 12:15:14 EST 2014


In article <mailman.5996.1390756093.18130.python-list at python.org>,
 Chris Angelico <rosuav at gmail.com> wrote:

> The set [A-z] is equivalent to
> [ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz]

I'm inclined to suggest the regex compiler should issue a warning for 
this.

I've never seen a character range other than A-Z, a-z, or 0-9.  Well, I 
suppose A-F or a-f if you're trying to match hex digits (and some 
variations on that for octal).  But, I can't imagine any example where 
somebody wrote A-z and it wasn't an error.



More information about the Python-list mailing list