-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Add "global" option to regexp_replace
#4331
Labels
feature
New features or missing components of existing features
Comments
@acquamarin DuckDB has a "global" option available via the This is how it would be used:
Once this is implemented, I can add some docs describing this. |
prrao87
changed the title
Feature: Add
Feature: Add "global" option to Oct 16, 2024
regexp_replace_all
functionregexp_replace
This was referenced Oct 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
API
Other
Description
We have a function called
regexp_replace
that replaces only the first match of a string based on a regex.However, we should also provide an option to replace all occurrences of a match, via a function
regexp_replace_all
. Example below.I have this JSON file
persons.json
:I want to generate a unique string primary key that's a concatenation of all the address fields, that I can then use for relationship creation downstream. During this process, I want to remove all whitespaces.
I'm doing this right now:
Because only the first occurrence is matched, I get this result for the
id
field:There's an extra space in the middle that wasn't removed.
If we had a
regexp_replace_all
function, this would be resolved.The text was updated successfully, but these errors were encountered: