# Ruby v1.91 won't match literal plus sign

**URL:** <https://www.ruby-forum.com/t/ruby-v1-91-wont-match-literal-plus-sign/194110>\
**Category:** Ruby\
**Created:** [August 30, 2010, 4:31pm UTC](https://www.ruby-forum.com/t/ruby-v1-91-wont-match-literal-plus-sign/194110 "2010-08-30T16:31:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptremblett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dc4da7/32.png) [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Post date:** [August 30, 2010, 4:31pm UTC](https://www.ruby-forum.com/t/ruby-v1-91-wont-match-literal-plus-sign/194110/1 "2010-08-30T16:31:22Z")

</div>

text = “++”  
puts “matched plus sign” if text.index(/++/, 0)

Prints nothing. Using Regex.quote produces the same behavior.

A forum registration quiz, “puts ((‘11’ \* 2).to\_i)/2” also prints  
nothing but v1.86 prints 555.

---

<div class="post-metadata">

**Author:** ![ptremblett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dc4da7/32.png) [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Post date:** [August 30, 2010, 6:50pm UTC](https://www.ruby-forum.com/t/ruby-v1-91-wont-match-literal-plus-sign/194110/2 "2010-08-30T18:50:44Z")

</div>

On Aug 30, 2010, at 10:31 AM, Paul T. wrote:

> text = “++”  
> puts “matched plus sign” if text.index(/++/, 0)
> 
> Prints nothing. Using Regex.quote produces the same behavior.
> 
> A forum registration quiz, “puts ((‘11’ \* 2).to\_i)/2” also prints  
> nothing but v1.86 prints 555.

1.9.1 and 1.9.2 both work fine. Perhaps you have a particular bug in  
the exact version you have. What does your `ruby -v` say?

-Rob

Rob B.  
removed\_email\_address@domain.invalid [http://AgileConsultingLLC.com/](http://AgileConsultingLLC.com/)  
removed\_email\_address@domain.invalid [http://GaslightSoftware.com/](http://GaslightSoftware.com/)

---

<div class="post-metadata">

**Author:** ![ptremblett](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/dc4da7/32.png) [@ptremblett](https://www.ruby-forum.com/u/ptremblett)\
**Post date:** [August 30, 2010, 9:45pm UTC](https://www.ruby-forum.com/t/ruby-v1-91-wont-match-literal-plus-sign/194110/3 "2010-08-30T21:45:49Z")

</div>

On Aug 30, 10:31 am, Paul T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> text = “++”  
> puts “matched plus sign” if text.index(/++/, 0)
> 
> Prints nothing. Using Regex.quote produces the same behavior.

Works fine with ruby-1.9.1p378 on a Mac
