Skip to content

Add regex filtering support (Fixes #554)#882

Open
sabbellasri wants to merge 1 commit intodalance:masterfrom
sabbellasri:feature/regex-filter
Open

Add regex filtering support (Fixes #554)#882
sabbellasri wants to merge 1 commit intodalance:masterfrom
sabbellasri:feature/regex-filter

Conversation

@sabbellasri
Copy link

Added --text, --regex, --smart
Regex filtering path in View::filter
Interactive regex edit in watch mode (/, Enter, Esc)
regex moved to top-level dependencies for cross-platform build compatibility.

@sabbellasri sabbellasri force-pushed the feature/regex-filter branch from d0942a3 to 172e252 Compare March 12, 2026 17:50
@sabbellasri
Copy link
Author

Hi @dalance Following are the changes

Added new CLI search mode flags in opt.rs: --text, --regex, and --smart (mutually exclusive).

Kept existing text/numeric search logic unchanged, and added a separate regex path in view.rs so regex is only used when regex mode is active.

Added smart regex detection in util.rs (has_regex_syntax) to auto-switch behavior in --smart mode when regex-like symbols are present.

Added argument validation in main.rs:

--regex accepts only one pattern argument.
--smart also enforces single-pattern usage when regex syntax is detected.
Added interactive regex editing in watch mode in watcher.rs: press / to edit filter, Enter to apply, Esc to cancel, backspace support, and regex error display in header.

Updated dependency placement in Cargo.toml: moved regex to top-level [dependencies] so builds work on macOS/Linux/Windows (not only Linux/Android).

The CI checks appear to be waiting for workflow approval.
Could a maintainer please approve the workflow so the builds can run?

Thank you!

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.

1 participant