From: Sebastian Hungerecker Date: 2008-09-09T00:30:36+09:00 Subject: Re: Single backslash in a string. How?? Rafael Viana wrote: > I want to be able to tell if a variable contains the value "\d" What is the value "\d"? If your answer is "a (literal) backslash, followed by the letter d", then that's "\\d" (or '\d' if you will). Try this in irb: >> "\\d" == '\d' => true >> puts "\\d" \d => nil >> "\s" == '\s' => false >> "\s" == ' ' => true >> puts "\s" => nil >> puts '\s' \s => nil >> puts "\\s" \s => nil >> "\\s" == '\s' => true HTH, Sebastian -- NP: Depeche Mode - The Sinner In Me Jabber: sepp2k@jabber.org ICQ: 205544826