If your goal is to remove only the square brackets ([]
), you should adjust your regular expression to specifically target those characters.
regexp_replace(col1, "\\[|\\]", "")
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi Expert,
I am getting square brackets in empty spaces in databricks, i tired below but unable to remove it
[]
regexp_replace(col1, "[^a-zA-Z0-9]", "")
If your goal is to remove only the square brackets ([]
), you should adjust your regular expression to specifically target those characters.
regexp_replace(col1, "\\[|\\]", "")