Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'syntax': 0.04; 'differently': 0.07; 'plenty': 0.07; 'references,': 0.09; 'utilizing': 0.09; 'wrong,': 0.09; 'cc:addr:python-list': 0.11; '5:30': 0.16; 'assignments': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'idlelib': 0.16; 'do,': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'subject:need': 0.19; 'written': 0.21; 'programming': 0.22; 'cc:addr:python.org': 0.22; 'instance,': 0.24; 'recognize': 0.24; 'cc:2**0': 0.24; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'thus': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'apparently': 0.31; 'languages': 0.32; 'regular': 0.32; 'fri,': 0.33; "can't": 0.35; 'johnson': 0.35; 'one,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'does': 0.39; 'either': 0.39; 'how': 0.40; 'expression': 0.60; 'tell': 0.60; "you're": 0.61; 'name': 0.63; 'more': 0.64; 'within': 0.65; 'between': 0.67; 'jobs': 0.68; 'jul': 0.74; 'distinguish': 0.84; 'regexp': 0.84; 'tricky': 0.84; 'to:none': 0.92; 'rick': 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=d7Yu6wZfn9nsPnLNSRanMKI+5UIDyagJZ884NscuzOw=; b=k9enlldgGtdE20JvU+W7jI3eFbhG8NyOGdMdkTuLszIivJ6VPiR0+ipAxvzftJ5FC9 IzHi6dnyMVk0oFaQfclZ+Fny4Y+BQChstRkJM1qkaqHrgdmLDk5YwyDlD6Wb/2nHk1D/ C9KhcX+Y3N3w6/el+VsBJ5nvaNP0F60hj5b5zhzpRQaVvWdoGPiSLY2DM+VqMZdnibqk hlAuP7xFGcfRx4wwL0IrJsYfl2KsE7B+aV14PQHtZq044uII7wr0koyEyejlZCj8FbFU kQD4eT3V6WG1DOxfFZwLLwP/VIa32ha39lmWW3UhMpliX6/blJRB6djfL47iEkqDlWAD MSGA== MIME-Version: 1.0 X-Received: by 10.52.119.179 with SMTP id kv19mr996200vdb.3.1405649020956; Thu, 17 Jul 2014 19:03:40 -0700 (PDT) In-Reply-To: References: <6239bcaa-828f-499b-936d-69d022bb94ac@googlegroups.com> <467108ec-19e7-4089-8d5f-53a80244adaf@googlegroups.com> Date: Fri, 18 Jul 2014 12:03:40 +1000 Subject: Re: I need an idea for practise! 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1405649023 news.xs4all.nl 2969 [2001:888:2000:d::a6]:40054 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:74709 On Fri, Jul 18, 2014 at 5:30 AM, Rick Johnson wrote: > But don't tell me for a *SECOND* that a colorizer, and a > damn good one, can not be written utilizing regexps, because > you're either wrong, or you're scared, or you're ignorant, > or you're all of the above! It might well be able to *utilize* regexps (as Terry showed, the one in idlelib apparently does use them), but very few modern programming languages can be fully and correctly defined within the limits of regexp syntax. For instance, how can you recognize and thus colorize assignments differently from name references, to distinguish between "foo = 1" and "foo == 1"? Can you do that with a regexp? And there's plenty more syntax that's tricky to define. I might be wrong, and I might be ignorant, but I'm not scared. I know what a regular expression can and can't do, and it's not fear to avoid using them for jobs they can't do. ChrisA