因此,出于某种原因,在Scala 2.11中,我的锚定正则表达式模式充当未锚定的正则表达式模式。Scala锚定正则表达式作为未被传递的
scala> """something\.com""".r.anchored findFirstIn "app.something.com"
res66: Option[String] = Some(something.com)
scala> """^.something\.com$""".r.anchored findFirstIn "app.something.com"
res65: Option[String] = None
我认为第一个表达式将评估为None
像第二(手动输入锚),但它没有。
任何帮助,将不胜感激。