Replying to my own question, I found this:

http://stackoverflow.com/questions/1542214/weird-backslash-substitution-in-ruby

I now understand, so please ignore my bug question.

On Sat, Oct 10, 2015 at 10:37 AM, Gavin Sinclair <gsinclair / gmail.com>
wrote:

> I'm trying to emit two backslashes in a string (for a newline in LaTeX)
> and it's proving very difficult.
>
> Is the behaviour shown below a bug?
>
> irb(main):054:0> '\\\\'.bytes == [92,92]
> => true
> irb(main):056:0> "NL".sub('NL', '\\\\').bytes == [92,92]
> => false
>
> Thanks,
> Gavin
>