Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.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.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'script,': 0.07; 'subject:parsing': 0.09; 'received:209.85.214.174': 0.13; 'received:mail-iw0-f174.google.com': 0.13; 'wrote:': 0.15; 'awk': 0.16; 'brackets.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'matching': 0.16; 'pm,': 0.16; 'header:In-Reply-To:1': 0.22; 'wonder': 0.23; 'code': 0.24; '(and': 0.27; "i'm": 0.27; 'received:209.85.214': 0.28; 'lee': 0.28; 'message-id:@mail.gmail.com': 0.28; 'script': 0.29; 'problem': 0.29; 'sun,': 0.30; 'done': 0.33; 'to:addr:python- list': 0.34; '17,': 0.35; 'pretty': 0.35; 'regular': 0.36; 'file': 0.36; 'but': 0.37; 'could': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'either': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.40; 'expert': 0.62; 'subjectcharset:utf-8': 0.72; 'xah': 0.84; 'subject:little': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=/xfm175BUx5BwwUcPMONALYJqSPJ+xtJwtYZ+Nt8qwY=; b=Cz6j8QClabHptAdY9DbHRjSGHv7SLg83mUKxkJk65c5oOQOFVq0JB5EPgDdAK/y/L+ jWfA/cxKDsub2chh/t/moo27IcBn/nm8ziltWjUdn379Rj76CtVUuVfquXiffU+nE5RT L7QA+/VneMzkNh0F4c5SmDNcoVWsmq71wX7VI= MIME-Version: 1.0 In-Reply-To: <36037253-086b-4467-a1db-9492d3772e78@r5g2000prf.googlegroups.com> References: <36037253-086b-4467-a1db-9492d3772e78@r5g2000prf.googlegroups.com> Date: Sun, 17 Jul 2011 21:34:41 +1000 Subject: =?UTF-8?Q?Re=3A_a_little_parsing_challenge_=E2=98=BA?= From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310902484 news.xs4all.nl 23944 [2001:888:2000:d::a6]:33787 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9696 On Sun, Jul 17, 2011 at 5:47 PM, Xah Lee wrote: > the problem is to write a script that can check a dir of text files > (and all subdirs) and reports if a file has any mismatched matching > brackets. I wonder will it be possible to code the whole thing as a single regular expression... I'm pretty sure it could be done as a sed or awk script, but I'm insufficiently expert in either to do the job. ChrisA