Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
raw前缀可用于告诉编译器不要转义字符串中的任何字符。但是为什么当我尝试这样做时会出现编译错误?
raw
raw"\d".r // not escaped slash
您使用的是哪个版本的 Scala?在 2.10.0 中工作正常:
Welcome to Scala version 2.10.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_37). Type in expressions to have them evaluated. Type :help for more information. scala> raw"\d".r res0: scala.util.matching.Regex = \d