Skip to content
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

feat: duckdb replace_all with regex #1784

Merged

Conversation

camriddell
Copy link
Contributor

What type of PR is this? (check all applicable)

  • ๐Ÿ’พ Refactor
  • โœจ Feature
  • ๐Ÿ› Bug Fix
  • ๐Ÿ”ง Optimization
  • ๐Ÿ“ Documentation
  • โœ… Test
  • ๐Ÿณ Other

Related issues

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

If you have comments or can explain your changes, please do so below

Turns out all duckdb regex functions support a limited set of regex options that are documented here:
https://duckdb.org/docs/sql/functions/regular_expressions.html but not on their text functions page here https://duckdb.org/docs/sql/functions/char.html#regexp_replacestring-pattern-replacement.

Adding the global 'g' option prevents the regexp from returning after the first match :)

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

absolute legend mate! @camriddell

@MarcoGorelli MarcoGorelli added the enhancement New feature or request label Jan 10, 2025
@MarcoGorelli MarcoGorelli merged commit 58dd1d2 into narwhals-dev:main Jan 10, 2025
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants