------art_62029_11554145.1220882414149
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Mon, Sep 8, 2008 at 7:36 AM, Rafael Viana <rafa.viana / gmail.com> wrote:

> Lloyd Linklater wrote:
> > Rafael Viana wrote:
> >> Is it possible to have a string with a single backslash?
> >>
> >
> > Indeed.
> >
> > s  \foo"
> > p s
> >
> > "\foo"
>
>
>
> Hi, I'm very sorry for my bad example. This problem only occurs when I
> need the values "\d" and "\l" on the strings. I need to be able to
> compare this value to see if a string has it. (e.g.: if var  \d" do
> this...)
>
> When I do something like:
>
>  var  \d"
>  I get
>  "d"
>
>  But when I do:
>
>  var  \\d"
>  I get
>  "\\d"
>
>  And when I do:
>
>  var  \d'
>  I get
>  "\\d"
>
> Again, sorry for my bad example. I hope there's a solution for this.
> --
> Posted via http://www.ruby-forum.com/.
>
>
If you are searching for the literal \d string then "\\d" is what you want.
You have to escape that \ try puts "\\d" and see what you get.

-- 
"Hey brother Christian with your high and mighty errand, Your actions speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)

------art_62029_11554145.1220882414149--