From: "Michael W. Ryder" <_mwryder@...> Date: 2007-08-08T09:24:57+09:00 Subject: Re: Alternate Regular Expressions? 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"] > ) > Another way to do something like this is to use a "compound" regular expression where each part continues where the last one ended. Something like \@\.\* where $1 would be everything up to the @ sign, i.e. the name. $2 would be everything between the @ and the ., i.e. the ISP name. And $3 would be the remainder of the address. The only time something like this would fail would be an address like mine, where the ISP name is worldnet.att rather than just worldnet. > 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. > > >