Merged
Conversation
Contributor
|
We've done a bit of brainstorming with how to do a full-featured string match. I think a plugin for regex could work as a stop-gap until we have a full design in place. |
polyrtm
reviewed
Oct 3, 2019
src/plugins/match.rs
Outdated
| _ => { | ||
| return Err(ShellError::string(format!( | ||
| "Unrecognized type in params: {:?}", | ||
| args[0] |
Member
|
@rnxpyke Thanks! |
bobhy
added a commit
to bobhy/nushell
that referenced
this pull request
Oct 22, 2023
* Release notes for `0.76` Please add your important new features and breaking changes to the release notes by committing to/opening a PR against the `release-notes-0.76` branch. Thank you! * Add breaking change for plugin signature (nushell#775) * add breaking change * Update blog/2023-02-21-nushell_0_76.md --------- Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com> * add some info on debugging commands * release notes for nushell#7952 (nushell#777) * release notes for nushell#7952 * Fix html tags that broke CI * more debug notes * Add `profile` note and screenshot (nushell#778) * add ast to debug commands section * add breaking change (nushell#790) * Remove example stuff Don't let the lorem ipsum loose * added more breaking changes notes * trim down error message documentation in blog post * Add description of some commands * Do some polishing. sequence multiplication * Screenshot help of a plugin * Add section on nu plugin * Add section on background work and full log * Executive summary * Details to "mul" --------- Co-authored-by: WindSoilder <WindSoilder@outlook.com> Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com> Co-authored-by: Bob Hyman <bob.hyman@gmail.com> Co-authored-by: Jakub Žádník <kubouch@gmail.com> Co-authored-by: Reilly Wood <reilly.wood@icloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a simple plugin that filters a table with a regular expression. It requires two arguments. The column of the string that should match and the regex itself.
Example usage:
Return all hidden files in current directory:
ls | match name "^\."The implenetation fails when it encounters a row where no column/string pair is present. Alternatively it could drop the row silently.
Advantages:
Disadvantages
regexcratePersonally I think regex matching should be a full fletched command. That way it could interact with all the other thinks that are already possible or will be possible in the future. (easy negation, boolean and, boolean or etc.), but this is a quick and easy solution that would cover the basic usecases for now.