diff --git a/sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala b/sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala index 4ee6cae6ab4..815314e7639 100644 --- a/sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala +++ b/sql-plugin/src/main/scala/com/nvidia/spark/rapids/RegexParser.scala @@ -747,7 +747,7 @@ class CudfRegexTranspiler(mode: RegexMode) { e match { case RegexEscaped(ch) if escapeChars.contains(ch) => Some(escapeChars(ch).toString) case RegexEscaped(ch) if regexPunct.contains(ch) => Some(ch.toString) - case RegexChar(ch) if regexMetaChars.contains(ch) => Some(ch.toString) + case RegexChar(ch) if !regexMetaChars.contains(ch) => Some(ch.toString) case RegexSequence(parts) => parts.foldLeft[Option[String]](Some("")) { (all, x) => all match {