How to remove only letters from a string in BigQuery?
For example:
\n\nXXXX123456\nAAAA123456789\nXYZR12345678\nABCD1234567\n1111\n2222\n
\n\nI want the end result to look like:
\n\n123456\n123456789\n12345678\n1234567\n1111\n2222\n
\n\nSolution:
You can use regexp_replace()
:
select regexp_replace(str, '[^0-9]', '')\n
DataFreak
posted onEnjoy great content like this and a lot more !
Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds
Post Comment