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

Feature: support regexp_extract functions #17655

Open
sundy-li opened this issue Mar 26, 2025 · 3 comments · May be fixed by #17658
Open

Feature: support regexp_extract functions #17655

sundy-li opened this issue Mar 26, 2025 · 3 comments · May be fixed by #17658
Assignees
Labels
C-feature Category: feature

Comments

@sundy-li
Copy link
Member

sundy-li commented Mar 26, 2025

Summary

Description for this feature.

regexp_extract(string, pattern[, group = 0])

 regexp_extract('deep_seek', '([a-z ]+)_?', 1);  ---> deep

regexp_extract(string, pattern, name_list)

 regexp_extract('2023-04-15', '(\d+)-(\d+)-(\d+)', ['y', 'm', 'd'])  --->  {'y':'2023', 'm':'04', 'd':'15'}

regexp_extract_all(string, regex[, group = 0])

regexp_extract_all('deep_seek', '([a-z ]+)_?', 1)  --> [hello, world]

reference: https://duckdb.org/docs/stable/sql/functions/regular_expressions.html

@sundy-li sundy-li added the C-feature Category: feature label Mar 26, 2025
@KKould
Copy link
Member

KKould commented Mar 26, 2025

assign me

@KKould KKould linked a pull request Mar 26, 2025 that will close this issue
11 tasks
@KKould
Copy link
Member

KKould commented Mar 26, 2025

regexp_extract(string, pattern, name_list) This is no longer available in clickhouse. In this case:

SELECT regexp_extract('Color: #FF00BB', '(?P<color>#(\\w{2})(\\w{2})(\\w{2}))', ['color', '2', '3'])

the standard result cannot be verified, do you think this should return {"color": "#FF00BB", "2": "FF", "3": "00"} or {"color": "#FF00BB", "2": "00", "3": "BB"}

Image

Tips: regexp_extract_all also cannot be used, but its meaning is relatively clear

@sundy-li
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants