com.gu.commercial.display.Cleaner.scala Maven / Gradle / Ivy
The newest version!
package com.gu.commercial.display
object Cleaner {
val illegalChars = """"'=!+#*~;^()<>[]&"""
val illegalCharRegex = {
val escapedChars = illegalChars.replaceAll(".", "\\\\" + "$0")
s"[$escapedChars]".r
}
def cleanValue(v: String): String = illegalCharRegex.replaceAllIn(v.trim.toLowerCase, "")
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy