Giter VIP home page Giter VIP logo

Comments (3)

mptre avatar mptre commented on August 26, 2024

Interesting idea that also crossed my mind. The current implementation looks at
every byte in order to determine if it's a delimiter or not. One possible
solution in order to support both the current -d' option and-r' would be to
always use regular expressions internally. This might actually lead to a
reduction of #LOC which I find tempting.

Your `ps' example is a great use case. You can get quite creative with regular
expressions. Here's another idea: match file and line numbers from a compiler
output and open up your editor of choice with the erroneous file and line:

OPTS=$(make 2>&1
| yank -r '^[^:]+:[[:digit:]]+'
| awk -F : '{print "-t", $2, $1}')

$EDITOR $OPTS

I will definitely look into this!

On Fri, Oct 23, 2015 at 02:54:12AM -0700, Adrien Lavoillotte wrote:

With the seemingly canonical ps example, I'd like to be able to limit the selectable fields to PIDs, so maybe only numbers. Instead of specifying a selector, I'd give a regex (preferably PCRE):

ps | yank -r '\b\d+\b' | xargs kill

yank would then only go through number fields.

What do you think?


Reply to this email directly or view it on GitHub:
#16

from yank.

mptre avatar mptre commented on August 26, 2024

Update: since the support for arrow key bindings is now in testing I'm going to start implementing support for regex.

from yank.

mptre avatar mptre commented on August 26, 2024

See the new regex branch[1].

[1] #20

from yank.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.