Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'say,': 0.05; 'compiler': 0.07; 'subject:Questions': 0.07; 'suppose': 0.07; 'ascii': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'suggest': 0.14; 'wrote': 0.14; "wouldn't": 0.14; '4-5': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hex': 0.16; 'inclined': 0.16; 'listed,': 0.16; 'roy': 0.16; 'skip:[ 60': 0.16; 'variations': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'trying': 0.19; 'not,': 0.20; 'example': 0.22; 'cc:addr:python.org': 0.22; 'certainly': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'equivalent': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'character': 0.29; 'characters': 0.30; 'errors': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'are.': 0.31; 'this.': 0.32; 'figure': 0.32; "i'd": 0.34; "can't": 0.35; 'agree': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'should': 0.36; 'error.': 0.37; 'sometimes': 0.38; 'somebody': 0.38; 'issue': 0.38; 'extremely': 0.39; 'range': 0.61; "you're": 0.61; 'more': 0.64; 'smith': 0.68; 'article': 0.77; 'a-z,': 0.84; 'tricky': 0.84; 'warnings.': 0.84; 'to:none': 0.92; 'imagine': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=Pj3OcjIS88ouCSGrdMMSemcyxCuritq3tLeAgRJsrHY=; b=0MG8jN5a6qBvL0eFI7aS5OU4Dz6oM9a6chb2sxO6idYB+53Vst6dtPPnqhkOuO+2xf WlYL3FAZbZUWHPakfsotocPsteQv6fjuNKHXTL2bXp9xujsDEVfw+cTpCWjSWJbY9988 42KjPYZ23zlzI3oQss6F+ebm1oCucTd88h0LCEWCLM3vsyWefh2JsZDY8M9Y3kPZ72cf i9OJCwKEOHbkRGfVPSlub8Jdc0wY3d7o/uS44sheJYrh07cjMxaHOOP1y8B5B8XeiPHv ZVcSCTWPvMdmLJTxOJRhs6RblQ8YKwXAPNtpLWE3EqCLlh0JNTKd5tOURf/c9AwGNrcv 1CqA== MIME-Version: 1.0 X-Received: by 10.66.164.229 with SMTP id yt5mr26217482pab.67.1390757129618; Sun, 26 Jan 2014 09:25:29 -0800 (PST) In-Reply-To: References: <3f568767-e13a-4c7d-a4fb-85caca2adf6e@googlegroups.com> Date: Mon, 27 Jan 2014 04:25:29 +1100 Subject: Re: re Questions From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1390757137 news.xs4all.nl 2915 [2001:888:2000:d::a6]:40570 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:64784 On Mon, Jan 27, 2014 at 4:15 AM, Roy Smith wrote: > In article , > Chris Angelico 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. I've used a variety of character ranges, certainly more than the 4-5 you listed, but I agree that A-z is extremely likely to be an error. However, I've sometimes used a regex (bytes mode) to find, say, all the ASCII printable characters - [ -~] - and I wouldn't want that precluded. It's a bit tricky trying to figure out which are likely to be errors and which are not, so I'd be inclined to keep things as they are. No warnings. ChrisA