help?> @raw_str
Create a raw string without interpolation and unescaping. The exception is that quotation marks still must be escaped. Backslashes escape both quotation marks and other backslashes, but only when a sequence of backslashes precedes a quote character. Thus, 2n backslashes followed by a quote encodes n backslashes and the end of the literal while 2n+1 backslashes followed by a quote encodes n backslashes followed by a quote character.
julia> println(raw"\ $x")
# \ $x
julia> println(raw"\"")
# "
julia> println(raw"\\\"")
# \"
julia> println(raw"\\x \\\"")
# \\x \"
julia> println(raw"\\\"x")
# \"x
As I understand, these rules apply equally to @r_str and any other string macro.
For a custom string macro to be exempt from the escaping rules above, it would need to have a way to hook into the parsing process. So, unless I’m misunderstanding something, I don’t see how I could write a string macro that doesn’t inherit these escaping semantics.