From: Richard Lionheart Date: 2004-07-09T23:28:50+09:00 Subject: Re: Anomoly using pattern to remove superfluous final \, if present Hi Robert, I originally sent this reply directly to you rather than the group. It's repeated here in case the first one got lost in your "bit bucket" and to mention an adaptation for the problem at hand > It seems to me quite inefficient to reverse a string > only to match it with "^". > > s.chop! if /\\$/ =~ s > > I guess another efficient method is > > s.slice!(-1,1) if s[-1] == ?\\ Excellent guidance!! In this case, I'll employ the first since it involves fewer keystrokes, though I expect the second might be a microsecond faster. My goal was to chop a final backslash it was immediately preceded by another backslash. So I'll use: s.chop! if /\\\\$/ =~ s Again, thanks for your insight! Regards, Richard --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.713 / Virus Database: 469 - Release Date: 7/7/2004