string.c: search by rb_str_index

* re.c (match_regexp): set regexp for MatchData from string.
* re.c (rb_backref_set_string): create MatchData from string and
  set backref.
* string.c (rb_pat_search, rb_str_sub, rb_str_sub_bang, str_gsub),
  (scan_once, rb_str_scan, rb_str_partition): use rb_str_index
  instead of rb_reg_search() when pattern is a String.  based on
  the patch by Sam Rawlins <sam.rawlins@gmail.com> [Fixes GH-579]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e