Skip to content
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

Support more regex types #21

Closed
13 tasks done
tavianator opened this issue Apr 25, 2017 · 12 comments
Closed
13 tasks done

Support more regex types #21

tavianator opened this issue Apr 25, 2017 · 12 comments

Comments

@tavianator
Copy link
Owner

tavianator commented Apr 25, 2017

Findutils offers

  • findutils-default
  • awk
  • egrep
  • ed
  • emacs
  • gnu-awk
  • grep
  • posix-awk
  • posix-basic
  • posix-egrep
  • posix-extended
  • posix-minimal-basic
  • sed
@kaushalmodi
Copy link

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.)

@data-man
Copy link
Contributor

I'd choose https://github.com/kkos/oniguruma.

@tavianator if you don't mind, I might do this task. :)

@tavianator
Copy link
Owner Author

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.

@data-man
Copy link
Contributor

Ok.

What do you prefer?

  • to use system library
  • keep it in this repository (personally I'd prefer it)

@tavianator
Copy link
Owner Author

In this case I'd prefer to link with the system library rather than vendoring it

@data-man
Copy link
Contributor

data-man commented Oct 18, 2021

Got it!
I asked because many programmers don't like to add dependencies. :)

@data-man
Copy link
Contributor

The first small step: #81

@data-man
Copy link
Contributor

Probably PEG can be added to your list. E.g. using awesome https://github.com/soasme/PeppaPEG.
It would be a unique feature!

@tavianator
Copy link
Owner Author

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";'

@data-man
Copy link
Contributor

bfs -fpeg <filename> and users can keep PEGs somewhere.

Another great idea: fuzzy match.
Something like Reverse Engineering Sublime Text’s Fuzzy Match.

@tavianator
Copy link
Owner Author

tavianator commented Jan 30, 2022

@data-man Any idea why the new test from c898af1 fails when building with Oniguruma?

@tavianator
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants