cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regexp_replaces pattern only once

sriramnedunuri
New Contributor III
select  regexp_replace('asdfhsdf&&1&&asdfasdf&&2&&asdf','&&[0-100]&&','') output
 
here it replaces first pattern but not the 2nd pattern
o/p
output
asdfhsdfasdfasdf&&2&&asdf
 
 
even if we use position its not working  something like  both wont work
 
select  regexp_replace('asdfhsdf&&1&&asdfasdf&&2&&asdf','&&[0-100]&&','',2) output
 
select  regexp_replace('asdfhsdf&&1&&asdfasdf&&2&&asdf','&&[0-100]&&','',15) output
1 ACCEPTED SOLUTION

Accepted Solutions

sriramnedunuri
New Contributor III

changing to [0-9] works this can be closed.

View solution in original post

1 REPLY 1

sriramnedunuri
New Contributor III

changing to [0-9] works this can be closed.