Ari Brown wrote: > Just randomly curious - > > Is there an alternate RegExp "language" to the current one in Ruby and > Perl? I don't know. So here's a dissertation on where to start. The good news is a RegExp is only two things at heart... - a Domain-Specific Language to program - a state machine. The bad news is, back in the day, people used to invent DSL as long strings of easily parsed characters. For example, a language called LSYSTEM might describe turtle graphics like this: s=[::cc!!!!&&[FFcccZ]^^^^FFcccZ] # upper spikes The really bad news is RegExp is one of these string-oriented DSLs that stuck. It will always be useful, so programmers forget how much room it has for improvement. The good news is Ruby excels at generating light DSLs. The equivalent expression for a modern implementation of LSYSTEM might look like this: upper_spikes = push.twist(2).thinner(2).increase_angle(4).... etc. Because Ruby gives your programming interfaces extreme notational flexibility, you can declare the interfaces most convenient for your domain. So start writing! and research other DSLs as you go. For example, here's a DSL written with C++ metaprogramming: http://boost-sandbox.sourceforge.net/libs/xpressive/doc/html/index.html Whenever you like, that language slips back to raw RegExp. Your effort should have a similar shunt. > English is like a pseudo-random number generator - there are a bajillion > rules to it, but nobody cares. Of all the world's languages, English is both the ugliest and the beautifulest. -- Phlip http://www.oreilly.com/catalog/9780596510657/ "Test Driven Ajax (on Rails)" assert_xpath, assert_javascript, & assert_ajax