+1 Nathan, Lachie. To me the 're' lib looks like a new syntax and another layer of indirection, which is likely going to be more, rather than less, work to figure out than a well-written vanilla regexp ...
On Wed, Feb 17, 2010 at 7:17 PM, Mikel Lindsaar <[email protected]> wrote: > On Wed, Feb 17, 2010 at 4:48 PM, Nathan de Vries <[email protected]> wrote: > > I seem to remember that when I worked with TMail a couple of years back, > addresses were checked for RFC2822 compliance using a regular expression. > Despite being broken up into readable chunks like my example, it was still > far too complex to read & modify. Looking at the new Mail gem, it has been > rewritten using TreeTop: > > > > http://bit.ly/c42qmm > > > > I think it's a pretty good example of where regular expressions cease to > be useful, and a more intuitive parsing expression grammar is more > appropriate. > > Being the guilty party that wrote that Treetop grammar, I guess I > should chime in :) > > I maintained TMail for 3 years before I decided to write Mail. When I > started, I looked at Regex's to do it, but it just got out of hand... > I ended up scrapping the whole thing and turning to treetop. It > became surprisingly simple after that. > > There are still some gotchas, and I am not sold on the speed, but it > is _very_ robust. > > Mikel > > -- > http://lindsaar.net/ > > -- > You received this message because you are subscribed to the Google Groups > "Ruby or Rails Oceania" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<rails-oceania%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/rails-oceania?hl=en. > > -- cheers, David Lee -- You received this message because you are subscribed to the Google Groups "Ruby or Rails Oceania" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rails-oceania?hl=en.
