--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
scala> :pa -raw
// Entering paste mode (ctrl-D to finish)
package scala.util.matching { object X { def x(p: java.util.regex.Pattern) = new Regex(p) } }
// Exiting paste mode, now interpreting.
<console>:1: error: illegal start of definition
package scala.util.matching { object X { def x(p: java.util.regex.Pattern) = new Regex(p) } }
^
package utils
import java.util.regex.Pattern
import scala.util.matching.Regex
object RegexHelper {
def applyThat(regexExp: String, context: String) = {
val myPattern: Pattern = java.util.regex.Pattern.compile("abc", java.util.regex.Pattern.CASE_INSENSITIVE)
val r = X.x(myPattern)
"ABC" match { case r(_*) => }
}
}
object X { def x(p: java.util.regex.Pattern) = new Regex(p) }
type mismatch;
found : java.util.regex.Pattern
required: String
object X { def x(p: java.util.regex.Pattern) = new Regex(p) }