From: Jack Dempsey Date: 2002-01-12T15:01:03+09:00 Subject: RE: Another suggestion for FreeRIDE ok, i can see the problem, what do you suggest for the solution? a check to see if its not enclosed in []'s? are there other situations? jack -----Original Message----- From: David Alan Black [mailto:dblack@candle.superlink.net] Sent: Friday, January 11, 2002 11:20 PM To: ruby-talk ML Subject: RE: Another suggestion for FreeRIDE Hello -- I seem to be in thorn-in-the-side mode tonight :-) On Sat, 12 Jan 2002, Jack Dempsey wrote: > Here's the code for that: easy, but it'll do the subs...i left the > outputting of "require english.rb" to the end user... > > #!/usr/bin/ruby > > text = 'this is some text that uses variables like $!, $;, $=, and $0.' > > hash_map = { > '$!' => '$ERROR_INFO', > '$@' => '$ERROR_POSITION', # ... > } > > puts text > hash_map.each { |k,v| > text.gsub!(Regexp.escape(k),v) > } > puts text re = /[abc$!]$/ Trouble... David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav