Why? This doesn’t seem to make any sense. Is it a bug?
It is intentional. In re.c:rb_reg_quote()
switch (c) {
case '[': case ']': case '{': case '}':
case '(': case ')': case '|': case '-':
case '*': case '.': case '\\':
case '?': case '+': case '^': case '$':
case ' ': case '#':
case '\t': case '\f': case '\n': case '\r':
goto meta_found;
}
And then down in meta_found:
case ' ':
*t++ = '\\';
*t++ = ' ';
continue;
Kirk H.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.