From: Andrew Stone Date: 2007-02-08T09:34:28+09:00 Subject: Re: Wanting clarification for string delimiters ------=_Part_10605_7148908.1170894865264 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 2/7/07, Neville Franks wrote: > > %q, %Q, %w, %r, %x all begin a string which terminates with the > character that matches the character after %q etc. eg. %q[blah] %q/blah/ > > But what are the rules for %SomeChar. eg %(blah) works as does %/blah/ > and %+blah+ > > However %AblahA doesn't, nor does %1blah1. Does this mean the delimiter > following % must be a punctuation character? Other than the predefined > %q etc. listed above of course. > > http://www.zenspider.com/Languages/Ruby/QuickRef.html states: > --- > > In all of the %() cases below, you may use any matching characters or > any single character for delimiters. %[], %!!, %@@, etc. > > 'no interpolation' > "#{interpolation}, and backslashes\n" > %q(no interpolation) > %Q(interpolation and backslashes) > %(interpolation and backslashes) > `echo command interpretation with interpolation and backslashes` > %x(echo command interpretation with interpolation and backslashes) > > --- > > This says "any single character" etc. which isn't correct in my testing. > > This is for the continuing work I'm doing on adding Ruby syntax to our > IDE ED4W. > > --- > Neville Franks, http://www.getsoft.com http://www.surfulater.com > > -- > Posted via http://www.ruby-forum.com/. > > According to the "Programming Ruby" book the delimiter can be any nonalphanumeric or nonmultibyte character. -andy ------=_Part_10605_7148908.1170894865264--