fork(2) download
  1. object Main extends App {
  2. val s = """"\This string\\ \contains some\ backslashes\""""
  3. println(s)
  4. val rx = """(?<!\\)\\(?!\\)""".r.unanchored
  5. val ismatch = s match {
  6. case rx(_*) => true
  7. case _ => false
  8. }
  9. println(ismatch)
  10. }
Success #stdin #stdout 0.15s 322496KB
stdin
Standard input is empty
stdout
"\This string\\ \contains some\ backslashes\"
true