bfs
bfs copied to clipboard
Support more regex types
Findutils offers
- [ ] findutils-default
- [ ] awk
- [ ] egrep
- [x] ed
- [x] emacs
- [ ] gnu-awk
- [x] grep
- [ ] posix-awk
- [x] posix-basic
- [ ] posix-egrep
- [x] posix-extended
- [ ] posix-minimal-basic
- [x] sed
I think that posix-extended is the best of those, and I am glad that that's supported.
One option that's not in that list, that even find
does not have, is PCRE. Can you please add support for that? (grep
supports PCRE with the -P
switch.)
I'd choose https://github.com/kkos/oniguruma.
@tavianator if you don't mind, I might do this task. :)
Feel free! I'm not too familiar with oniguruma, but it looks like it might be customizable enough to be compatible with the various GNU regex flavours.
Ok.
What do you prefer?
- to use system library
- keep it in this repository (personally I'd prefer it)
In this case I'd prefer to link with the system library rather than vendoring it
Got it! I asked because many programmers don't like to add dependencies. :)
The first small step: #81
Probably PEG can be added to your list. E.g. using awesome https://github.com/soasme/PeppaPEG. It would be a unique feature!
I'm a fan of PEGs (and that project name is a laugh) but I'm not sure what the utility is for bfs
. I don't expect people to search for files like bfs -peg 'name = num "." ext; num = [0-9]+; ext = "jpg" | "png";'
bfs -fpeg <filename>
and users can keep PEGs somewhere.
Another great idea: fuzzy match. Something like Reverse Engineering Sublime Text’s Fuzzy Match.
@data-man Any idea why the new test from https://github.com/tavianator/bfs/commit/c898af13a671ee92a056467d324f16823594eb1c fails when building with Oniguruma?
Oh wait, I see. Turns out that \(thing\|other\)
is not actually part of POSIX basic regular expressions. But glibc supports it as an extension. Will revert that.