After looking at the stack trace carefully, I see what's happening.
You can see that the method s
is executed on the string, which handles the replacement of $SIGN
. That method encounters the \d
in the string and apparently tries to translate this; see the call to treatEscapes
in the stack trace. The treatEscapes
method doesn't recognize \d
and throws an exception.
It can be fixed by writing \\d
in the string, but that defeats the whole purpose of having a triple-quoted string...
Conclusion: It seems like string interpolation and triple-quoted strings interfere with each other. I'd say this is a Scala bug. (Why does the s
method treat escapes?).
edit - This indeed looks like bug SI-6476 as Travis Brown pointed out in a comment.