2
작은 따옴표 붙은 문자열에 대한 이스케이프 규칙이 다음 예제에서 일치하지 않게 보입니다. 작은 따옴표로 묶은 문자열을 이스케이프 처리하는 규칙은 무엇입니까?작은 따옴표 문자열의 일치하지 않는 이스케이프 동작
p str1 = 'a\b\c'
#=> "a\\b\\c" looks fine, I know single quotes don't do escaping
p str2 = 'a\\b\\c'
#=> "a\\b\\c" hmm? It actually escapes
# Trying double quotes
p str3 = "a\b\c"
#=> Error, \c isn't valid
p str4 = "a\\b\\c"
#=> "a\\b\\c"
p str1 == str4, str2 == str4
# true, true