-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add an option similar to -o, --only-matching #34
Comments
Note that surrounding the search regex with .( ). and then using --replace $1 will do this; pretty verbose though, especially when using it in a pipeline. |
|
Input
Output
Hash is coloured red, but I need hash (that red part) only. |
@sergeevabc Yes, it would solve your problem. But there is a work-around for now:
|
@BurntSushi, thanks, but when |
@sergeevabc I don't know. It happens when it happens. I do this in my free time and I don't typically schedule my free time in advance. Sorry. |
To counterbalance the above comment, I wanted to say that I use and enjoy this excellent tool you've created every day, and I appreciate whatever improvements are made whenever they are made. Thanks for using some of your limited free time to make my life and others' easier. |
@sergeevabc This issue tracker isn't place to give me advice on how to schedule my free time or to shame anyone into doing work on their free time. Future comments in that vain won't be tolerated. |
Wonderful, thank you for the great work @kpp + @BurntSushi 🎉 |
With grep you can print only the matched parts of the files. The option is described like this in the grep manpage:
A more powerful option, would something similar to
--replace
, but that doesn't print the non matched part of the text.The text was updated successfully, but these errors were encountered: