the Pattern Matching is not working but why?
def replaceEmployerNameContainingAmpersand(emplName: String): String = {
val r = "(?<! )&(?! )".r
val r2 = "&(?! )".r
val r3 = "(?<! )&".r
emplName match {
case r() => emplName.replaceAll("(?<! )&(?! )", " & ")
case r2() => emplName.replaceAll("&(?! )", "& ")
case r3() => emplName.replaceAll("(?<! )&", " &")
}
}
The given String should match it is not why?