https://github.com/bleutner/big_grep
big_grep - grep's hungry cousin
https://github.com/bleutner/big_grep
Last synced: 12 months ago
JSON representation
big_grep - grep's hungry cousin
- Host: GitHub
- URL: https://github.com/bleutner/big_grep
- Owner: bleutner
- License: gpl-3.0
- Created: 2022-04-26T08:12:46.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-26T09:22:08.000Z (about 4 years ago)
- Last Synced: 2025-03-04T01:31:29.783Z (over 1 year ago)
- Language: C++
- Size: 1.57 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# big_grep - grep's hungry cousin
big_grep was written to complement GNU grep for a very large number of matching patterns.
Essentially it does this:
```bash
grep "pattern1|pattern2|pattern3" reference_file
```
However, if you have a lot of patterns you want to match with GNU grep you will at some point hit the limits of argument length.
Big grep uses a pattern file where each line is a pattern, and matches those.
## Installation
Note that compilation requires libboost-regex headers, because I wanted to be able to user Perl-style regexes and usually have boost available in all my environments (`libboost-regex-dev` on Ubuntu).
```bash
# Clone
git clone https://github.com/bleutner/big_grep.git
cd big_grep
# Compile
make
## Run
bin/big_grep -h
```
## Usage
```
USAGE: big_grep [args] -p -i
DESCRIPTION:
Matches every pattern of against every line in .
This is useful for large numbers of patterns, which exceed the normal 'GNU grep'
input limits. Inclusive (default) or exclusive matching modes are possible.
ARGUMENTS:
-i [filename]: target input file
-p [filename]: file with patterns to match
-o [filename]: output file (optional)
-v: inverse mode, i.e. exclude matches (optional)
-r: perl-style regex which is used to extract a substring from ,
which is then searched for in (optional)
-t: test regex on first line of and exit
-h: print help and exit
-V: print program version
```