Почему здесь есть совпадение:
scala> """\bdog\b""".r
res65: scala.util.matching.Regex = \bdog\b
scala> res65.findFirstIn(" The dog plays in the yard")
res66: Option[String] = Some(dog)
Но не здесь:
scala> "The dog plays in the yard".matches("""\bdog\b""")
res67: Boolean = false
?