-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Using Oniguruma library (optionally) #81
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! Just some minor comments for now, but I'm excited to see it support other regex types.
@tavianator What else can I do in this PR? |
Mostly I just need to try it out myself, haven't gotten to it yet. Also, even if it's incomplete, if you have an example of how it would enable a new regex flavour that would be good to see. |
First we need to define a switches for RE dialects. |
There's already |
Ok, got it! |
I'm open to a release that just adds the library without the new regex flavours, but I'd like to see that it's at least possible to implement them with this library |
/* predefined syntaxes (see regsyntax.c) */
#define ONIG_SYNTAX_ASIS (&OnigSyntaxASIS)
#define ONIG_SYNTAX_POSIX_BASIC (&OnigSyntaxPosixBasic)
#define ONIG_SYNTAX_POSIX_EXTENDED (&OnigSyntaxPosixExtended)
#define ONIG_SYNTAX_EMACS (&OnigSyntaxEmacs)
#define ONIG_SYNTAX_GREP (&OnigSyntaxGrep)
#define ONIG_SYNTAX_GNU_REGEX (&OnigSyntaxGnuRegex)
#define ONIG_SYNTAX_JAVA (&OnigSyntaxJava)
#define ONIG_SYNTAX_PERL (&OnigSyntaxPerl)
#define ONIG_SYNTAX_PERL_NG (&OnigSyntaxPerl_NG)
#define ONIG_SYNTAX_RUBY (&OnigSyntaxRuby)
#define ONIG_SYNTAX_PYTHON (&OnigSyntaxPython)
#define ONIG_SYNTAX_ONIGURUMA (&OnigSyntaxOniguruma) |
Thanks! |
Can be tested by
$ make USE_ONIGURUMA=1
. Of course Oniguruma should be installed, e.g.$ sudo apt install libonig-dev
.I only tested on Linux. ;)