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

Filterx regexp_search rework #399

Merged
merged 4 commits into from
Dec 3, 2024
Merged

Conversation

bshifter
Copy link
Member

continuation of #394
based on #392

Introduced two new optional flags: keep_zero and list_mode.
The result type no longer switches between dict and list based on the presence of named groups.
The default result type is now dict.
list_mode can force a list result, either via the flag or the type of the fillable (the fillable's type takes precedence).
Match group zero is now excluded by default unless no other groups are present. This behavior can be overridden using the keep_zero flag.

Additionally, the FilterXRematchState structure, shared across other regexp functions, has been updated with a generic flags field. This allows functions to pass custom options to the state without incurring additional overhead.

@bshifter bshifter force-pushed the filterx-regexp-search branch 3 times, most recently from 968c9d0 to 355d819 Compare December 2, 2024 11:27
@bshifter bshifter mentioned this pull request Dec 3, 2024
alltilla
alltilla previously approved these changes Dec 3, 2024
Copy link
Member

@alltilla alltilla left a comment

Choose a reason for hiding this comment

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

Nice feature!

Please rebase so we can merge it.
This also needs a news entry, but can be in another PR

@bshifter bshifter dismissed alltilla’s stale review December 3, 2024 14:24

The merge-base changed after approval.

add macro to define flag_names

Signed-off-by: shifter <[email protected]>
Introduced two new optional flags: keep_zero and list_mode.
The result type no longer switches between dict and list based on the presence of named groups.
The default result type is now dict.
list_mode can force a list result, either via the flag or the type of the fillable (the fillable's type takes precedence).
Match group zero is now excluded by default unless no other groups are present. This behavior can be overridden using the keep_zero flag.

Additionally, the FilterXRematchState structure, shared across other regexp functions, has been updated with a generic flags field. This allows functions to pass custom options to the state without incurring additional overhead.

Signed-off-by: shifter <[email protected]>
@bshifter bshifter force-pushed the filterx-regexp-search branch from 355d819 to ff6d70d Compare December 3, 2024 14:25
@alltilla alltilla merged commit 499f8e7 into axoflow:main Dec 3, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants