Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #76338

Re: PyMatch Tool.

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 <skip.montanaro@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'patterns': 0.04; 'say,': 0.05; 'matches': 0.07; 'ugly': 0.07; 'django,': 0.09; 'fashion.': 0.09; 'mess': 0.09; 'url:github': 0.09; 'cc:addr:python-list': 0.11; '(before': 0.16; 'chunks': 0.16; 'concert': 0.16; 'expressions.': 0.16; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; 'notation': 0.16; 'routinely': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'code.': 0.18; 'any,': 0.19; 'thu,': 0.19; 'input': 0.22; 'aug': 0.22; 'manual': 0.22; 'cc:addr:python.org': 0.22; 'closely': 0.24; 'skip': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'chris': 0.29; 'message-id:@mail.gmail.com': 0.30; 'program,': 0.31; 'bunch': 0.31; 'dawn': 0.31; 'facility': 0.31; 'regular': 0.32; 'run': 0.32; 'could': 0.34; 'tool': 0.35; 'but': 0.35; 'received:google.com': 0.35; '14,': 0.36; 'dates': 0.36; 'described': 0.36; 'maintained': 0.36; 'done': 0.36; "didn't": 0.36; 'similar': 0.36; 'so,': 0.37; 'two': 0.37; 'level': 0.37; 'pm,': 0.38; 'anything': 0.39; 'how': 0.40; 'easy': 0.60; 'problems.': 0.60; 'most': 0.60; "you're": 0.61; 'back': 0.62; 'information': 0.63; 'developed': 0.63; 'provide': 0.64; 'listings': 0.65; 'to:addr:gmail.com': 0.65; 'system)': 0.69; 'internet': 0.71; 'tour': 0.81; 'everything.': 0.84; 'fail.': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Wj3VFfIxuLUXU9T5JSSRjgRR7ipC3iCNHc+juaz3kwM=; b=zdfRHMP8vnG+0xyth2cQ9GIDvfR/8kJBr7E9ZcXiOPHhjjV1LxtN0+1g6RT87oCHCo 3AaxTl4SW653XIoN+X9YAc2puSXBBBG9zosupRVoWbYGM7TbvhcyckaCpcjzgbHq2S72 bYgGMG7n444LorgA2VdTEPmIJgrW25G3v/boMdko6aVLx+AthGzcyHVWxTRH3t0cb8Hi ef4fB0eukfHi/oYMAuaagId18hpOse9LZ+cCihJ05KCm/tlmtFdf0SQVK4f2rfXUHCoa CPZhNGu+WfbT+dNhNBFQxckJXIA894qeF6NPcqrqa0YVmbNgCG/03qzLKdZ+ULGGvELK jjjw==
MIME-Version 1.0
X-Received by 10.50.61.138 with SMTP id p10mr1161007igr.20.1408062663854; Thu, 14 Aug 2014 17:31:03 -0700 (PDT)
Sender skip.montanaro@gmail.com
In-Reply-To <CAPTjJmqhZE7M88cENbNqT+f94heEoLM1nivQoKRb0vAz3QAbig@mail.gmail.com>
References <198ac789-f8e3-4f81-b10f-d7b29c25a70f@googlegroups.com> <CAPTjJmqhZE7M88cENbNqT+f94heEoLM1nivQoKRb0vAz3QAbig@mail.gmail.com>
Date Thu, 14 Aug 2014 19:31:03 -0500
X-Google-Sender-Auth LsEbTkj9sTfUQgfd8t8_qxsUUN4
Subject Re: PyMatch Tool.
From Skip Montanaro <skip@pobox.com>
To Chris Angelico <rosuav@gmail.com>
Content-Type text/plain; charset=UTF-8
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.13014.1408062666.18130.python-list@python.org> (permalink)
Lines 33
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1408062666 news.xs4all.nl 2879 [2001:888:2000:d::a6]:49982
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:76338

Show key headers only | View raw


On Thu, Aug 14, 2014 at 5:49 PM, Chris Angelico <rosuav@gmail.com> wrote:
>
> > Tool -> https://github.com/rfunix/PyMatch
>
> How is this better than GNU sed?

I didn't look closely at the program, but I have an idea how I might use it.

Back in the dawn of Internet time (before Y2K, Django, V8, etc) I
developed and maintained a concert calendar website. It had a database
of tour dates, and a bunch of handwritten HTML. And, I allowed people
to describe their concert tour information in a
slightly-higher-than-regex level (SLTRL). This facility allowed me to
routinely process known tour date listings and update my listings with
little, if any, manual intervention.  Under the covers, of course, it
used regular expressions. I had, as they say, two problems.

My solution to failed matches (I was actually the heaviest user of the
system) was to provide a <textarea> where you could paste in some tour
dates as they appeared on an artist's website, then enter the SLTRL
notation you thought described the dates. Most of the time things were
pretty easy to handle, but every now and then it would fail. I would
then start lopping of chunks of the SLTRL from the right and see if
anything now matched, and if so, what was leftover.

This tool might work in a similar fashion. Run it repeatedly on the
same input with ever-more-complex patterns and groups until it matches
everything. Then you're done and you paste the ugly mess into your
code.

Then you have two problems. <wink>

Skip

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

PyMatch Tool. rafinha.unix@gmail.com - 2014-08-14 12:50 -0700
  Re: PyMatch Tool. Chris Angelico <rosuav@gmail.com> - 2014-08-15 08:49 +1000
  Re: PyMatch Tool. Skip Montanaro <skip@pobox.com> - 2014-08-14 19:31 -0500
  Re: PyMatch Tool. Christian Gollwitzer <auriocus@gmx.de> - 2014-08-15 22:59 +0200
    Re: PyMatch Tool. Rafael Francischini <rafinha.unix@gmail.com> - 2014-08-18 05:21 -0700
      Re: PyMatch Tool. Christian Gollwitzer <auriocus@gmx.de> - 2014-08-18 19:38 +0200
        Re: PyMatch Tool. Rafael Francischini <rafinha.unix@gmail.com> - 2014-08-18 13:14 -0700

csiph-web