Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Ka-Ping Yee <python-XLawsxctnuM <at> public.gmane.org>
Subject: Re: New pattern-matching library (was: str.split with multiple individual split characters)
Newsgroups: gmane.comp.python.ideas
Date: Monday 28th February 2011 18:53:28 UTC (over 6 years ago)
On Mon, 28 Feb 2011, Guido van Rossum wrote:
> On Mon, Feb 28, 2011 at 8:04 AM, Mike Meyer
 wrote:
>> Possibly we should investigate adding one of those to the standard
>> library, along with a cross-reference from the regexp documentation?
>
> It's been tried before without much success. I think it may have been
> a decade ago that Ka-Ping Yee created a pattern matching library that
> used function calls (and operator overloading? I can't recall) to
> generate patterns -- compiling to re patterns underneath. It didn't
> get much use.

Yes, there was operator overloading.  The expressions looked like this:

     letter + 3*digits + anyspace + either(some(digits), some(letters))

If anyone is curious, the module is available here:

    http://zesty.ca/python/rxb.py

You're welcome to experiment with it, modify it, use it as a starting
point for your own pattern matcher if you like.


--Ping
 
CD: 2ms