rubinius/rubinius — pull request #1856 by tsion (2012-08-12 06:25:00+00:00)
Title: Symbol#inspect is wrong for symbols with newlines

In both 1.8 and 1.9 mode:

``` irb
>> :"foo\nbar"
=> :foo
bar
```

This is how it works in MRI:

``` irb
>> :"foo\nbar"
=> :"foo\nbar"
```

The problem is that `^` and `$` in Regexps match not only the start/end of the string, but also newlines. Instead, I use `\A` which matches only the start of the string, and `\z` which matches only the end. Note that we can't use `\Z` because it still ignores newlines right at the end of the string, so `:"foo\n".inspect` would be broken.