-
Notifications
You must be signed in to change notification settings - Fork 178
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
Enable use of multiple patterns at the same time #3
Comments
Hi @mahdix - thanks for taking an interest :) There is another issue detailing this flaw - I agree with you both that the compiled pattern should be passed as a pointer to the compile function. I will see if I can find the time to implement this feature. Thank you for your feedback |
Hi, there is a fork of this library available which I ported to work in the kernel of the FreeBSD. https://github.com/komdivkote/tiny-regex-c Also there some tuning available in the re.h: #define RE_TRUNC_ARRAY_IF_POSSIBLE YES //YES - truncate array to reduce size, NO - do not #define RE_CHAR_CLASS_LENGTH 20 //per struct regex_t instance #define MIN_REGEXP_OBJECTS 30 //min number of regex symbols in expression. #define RE_BUILDWITH_DEBUG YES //compile with print and trace functions I will try to form a pull request without kernel code. |
Hi @komdivkote - wow you've really done something with the code :D A pull request would be awesome :) I really find it interesting to see how other people use my code. Anecdote: |
Oh, it looks like people asked for this feature (and provided some kind of implementations) multiple times in the past. @kokke, what do you think about this issue? IMHO there should be some final decision: either merge one of implementations as an optional feature or mark it as "wontfix" and clearly mention in documentation that it doesn't fit well here (and mention some featured alternatives for those who need this feature too much). What do you think? Some kind of perfectionism makes me worry about old stale issues, especially in small well-written projects where it looks definitely possible to achieve and maintain "zero known/open issues" state. |
Hi, There might be a simple solution for this (without dynamic memory allocation to keep original design):
Where
This function initialize
If user want to get compile failure reason, may be another parameter
|
Here's my attempt: #58 |
Compiled patterns are kept in a static variable which means they will be overwritten as soon as another pattern is compiled.
The text was updated successfully, but these errors were encountered: