grep [regular expressions search in text]

Submit command line tools that you find here.
Post Reply
Message
Author
User avatar
vevy
Posts: 795
Joined: Tue Sep 10, 2019 11:17 am

grep [regular expressions search in text]

#1 Post by vevy »


User avatar
webfork
Posts: 10821
Joined: Wed Apr 11, 2007 8:06 pm
Location: US, Texas
Contact:

Re: grep [regular expressions search in text]

#2 Post by webfork »

When a program listed in the database is an acronym or abbreviation, we list out the root of a program's naming, but with grep there's actually a bit of a (~50 year old) story behind it:

Where grep came from
https://www.youtube.com/watch?v=NTfOnGZUZDk

In addition to discussing why regular expressions are so odd and the early giants of UNIX Ken Thomas and Dennis Richie, it also goes into how the initial goal was text analysis, the thing that brought me to grep.

User avatar
vevy
Posts: 795
Joined: Tue Sep 10, 2019 11:17 am

Re: grep [regular expressions search in text]

#3 Post by vevy »

Yeah! Just a thread stub to be filled later. Sorry!

For the TL;DW (You should watch!):
g/re/p
g=global
re="regular expression" here
p=print matching lines

User avatar
rbon
Posts: 363
Joined: Wed Mar 28, 2007 2:16 am
Location: Italy

Re: grep [regular expressions search in text]

#4 Post by rbon »

I have found on GitHub a CLI scanner and regex extractor.

• Program name: rare
• rel. 0.1.2.7
• released: October 21, 2020
• GitHub project page: https://github.com/zix99/rare
• archive name: rare_0.1.27_Windows_x86_64.zip
• see Output Formats and all parameters on GitHub page
• Softpedia: https://www.softpedia.com/get/Programmi ... rare.shtml

Not tested.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook.

User avatar
vevy
Posts: 795
Joined: Tue Sep 10, 2019 11:17 am

Re: grep [regular expressions search in text]

#5 Post by vevy »

rbon wrote: Sun Oct 25, 2020 3:32 pm I have found on GitHub a CLI scanner and regex extractor.

• Program name: rare
• rel. 0.1.2.7
• released: October 21, 2020
• GitHub project page: https://github.com/zix99/rare
• archive name: rare_0.1.27_Windows_x86_64.zip
• see Output Formats and all parameters on GitHub page
• Softpedia: https://www.softpedia.com/get/Programmi ... rare.shtml

Not tested.
Thanks! Good-looking tool.

User avatar
webfork
Posts: 10821
Joined: Wed Apr 11, 2007 8:06 pm
Location: US, Texas
Contact:

Re: grep [regular expressions search in text]

#6 Post by webfork »

rbon wrote: Sun Oct 25, 2020 3:32 pm I have found on GitHub a CLI scanner and regex extractor.
Excellent suggestion. I was trying to sort out a way to go beyond just counting instances of a given term or value. I'm not sure if this will do what I was thinking, but just more tools in the realm of text analysis reports is a great thing.

User avatar
vevy
Posts: 795
Joined: Tue Sep 10, 2019 11:17 am

Re: grep [regular expressions search in text]

#7 Post by vevy »

One of the cool uses of grep (and any CLI tool that accepts stdin really), is "nested searching"; meaning you can look for lines that contain multiple certain words but without having to search them in a particular order.

For example,
grep "word 1" file.txt | grep "word 3" | grep "word 2"
will give you only the lines that contain all of the three words in any order.

Add to that a superb tool like gron ("make[­s] JSON grepabble") and some tasks just got a lot easier for a bunch of people!

Post Reply