From: Yossef Mendelssohn Date: 2007-08-07T22:11:27+09:00 Subject: Re: Alternate Regular Expressions? On Aug 6, 10:10 pm, Ari Brown wrote: > I'm moderately serious. This is going to be one of those projects > that won't see the light of day for maybe 6 months to a year. > This looks largely what I was hoping to make, although in Ruby I had > invisioned this: > > matching email addresses (sample): > a = LeetExp.new(:letters => [[a-z], :insensitive], > :string => "@", > :letters => [[a-z], :insensitive], > :string => ".", > :string => ["com", "net", "org", "edu"] > ) > > case line > when a > # ... > > My idea is to make it logical and human readable. Ruby is a language > for humans and UberBeings, and I think this should reflect Ruby's ideas. > > Also, was you library a wrapper for underlying PERL RegExp? or was it > the whole RegExp engine? > > Thanks, > Ari > > On Aug 6, 2007, at 10:51 PM, Kenneth McDonald wrote: > > > > > Ari, > > > How serious are you about this? Several years ago I wrote a Python > > library that treats Python regular > > expressions as semantic, not syntactic, objects, and that has been > > incredibly useful to me. I've started > > to port it to Ruby, but simply don't have the time. If you do > > (you're probably looking at a couple of > > weeks of full-time-equivalent hours to do a good job, including > > decent documentation), I'm happy to pass > > on the Python code, the Ruby code, and give advice and so on. > > > To help you evaluate this, and also as a potential source of ideas > > in case you do something else, I've > > appended my (probably out of date) intro text to the library at the > > bottom of this reply. > > > Cheers, > > Ken > > --------------------------------------------| > If you're not living on the edge, > then you're just wasting space. Ari, There have been other responses to this already, but I thought I'd give you something else to look at: http://bofh.org.uk/articles/2007/03/15/thats-not-fluent I second (or third, or whatever) the contention that regular expressions are pretty readable on their own (given some knowledge of the syntax and good formatting). The thing to keep in mind is that they're a language of their own. Once you learn the language, you find you can use it in many a programming language (though there are some dialectical problems here and there). -- -yossef