From: Mark Slagell Date: 2001-11-03T07:57:28+09:00 Subject: [ruby-talk:24224] literal \0 in String#gsub replacement Okay, I'm stuck on something seemingly trivial here. Is it possible for '\0' to be a literal part of the replacement string in gsub? I mean, without match data being substituted for it. Say I want '[foo]' to be replaced with '\003foo', etc. "apple [cherry] lemon".gsub(/\[(.+?)\]/,'\003\1' That substitutes for both the \0 and the \1, producing "apple [cherry]03cherry lemon" as it should of course. How can I make the \0 literal and get: "apple \003cherry lemon" Mark