From: Robert Feldt Date: 2001-10-24T04:00:28+09:00 Subject: [ruby-talk:23070] Re: splitting a string with nested elements On Wed, 24 Oct 2001, Joseph McDonald wrote: > Hi, > Hi, > Is there a way to do such a thing with a regex, or do I need to resort > to a scanning technique, keeping track of the nested elements? > Nested comments is the canonical example of what can *NOT* be done with regexps. But since I now said this I'm sure some smart ruby guru will tell you it can be done anyway (I'm not fully aware of the difference between RegularExpressions (the CS theory one) and their Perl and Ruby implementations). BTW, the an upcoming version of Rockit will have an expanded tokenizing/lexing/scanning formalism that can easily handle this. Regards, Robert