From: Rove Monteux Date: 2004-04-26T20:37:05+09:00 Subject: Re: Variable matching Thats correct ! Im forgetting to interpolate the variable. Thanks million, yes the variables are read from a xml file and used in more than one procedure, so yes its global. Thanks again ! Rove -- Rove Monteux Systems Administrator rove.monteux@fluid-rock.com Thomas Adam wrote: > --- Rove Monteux wrote: > Hi, > > >>Quite new to regex myself, Im trying to match a chunk of the text with >>the following, >> >>chunk = content.scan(/(.*)/m) >> >>That works alright, and its contents returned to the chunk string. Now >>Im trying to do that way, >> >>$start = "" >>$end = "" >> >>chunk = content.scan(/$start(.*)$end/m) >> >> > >I haven't tested this, but you are not interpolating the variables >correctly: > >chunk = content.scan(/#{$start}(.*)#{$end}/) > >Also, unlike Perl, the $ symbol does not denote type, but scope. Do you >really mean for start and end to be globally defined (which is what the $ >is implying?). > >Hope That Helps, > >-- Thomas Adam > >===== >"The Linux Weekend Mechanic" -- http://linuxgazette.net >"TAG Editor" -- http://linuxgazette.net > >" We'll just save up your sins, Thomas, and punish >you for all of them at once when you get better. The >experience will probably kill you. :)" > > -- Benjamin A. Okopnik (Linux Gazette Technical Editor) > > > > > >____________________________________________________________ >Yahoo! Messenger - Communicate instantly..."Ping" >your friends today! Download Messenger Now >http://uk.messenger.yahoo.com/download/index.html > > > > >