Fixed compliation errors in Regex.scala