From: dblack@... Date: 2006-07-16T08:00:27+09:00 Subject: Re: Help with a regexp Hi -- On Sun, 16 Jul 2006, Daniel Martin wrote: > dblack@wobblini.net writes: > >> On Sat, 15 Jul 2006, Daniel Martin wrote: >>> Perl allows bunches of special constructs in regular expressions that >>> sane languages, which like to keep the matching of regular expressions >>> away from being able to jump back into the host language. (Note that >>> perl combines this feature with extra language-level security support, >>> since most programmers would assume that a user-supplied regexp >>> couldn't execute arbitrary code) >> >> Ruby does let you jump back, though, with #{...}. But it looks like >> Perl does an extra level of compilation. (Unless I've got that >> backwards.) > > Ruby lets you do string interpolation with an easy syntax, and lets > you use that syntax even when writing a string that is being compiled > into a regular expression because it's surrounded by //. Perl has > that, too. This however is something different - the execution of > code in the host language at regular expression long after the > expression has been compiled, in the middle of doing a match. Right, I see what you mean. I think with "extra level of compilation" that's what I was groping toward -- really a post-compilation evaluation in a later context. Thanks -- David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy http://www.manning.com/black => RUBY FOR RAILS (reviewed on Slashdot, 7/12/2006!) http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log dblack@wobblini.net => me