-
Notifications
You must be signed in to change notification settings - Fork 0
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
Better to use macros #5
Comments
I'm not quite sure what you mean, so let me know this is the answer to the wrong question: In terms of performance, there's definitely an issue that this code allocates a whole bunch of unnecessary strings. I think this could be avoided using a similar strategy to |
In terms of options, I think those are all implemented.
|
It might not be to just construct them. My guess is that people would use your idea even in a loop, so I'm not sure if they would generate the same string in each iteration. Ok, let's say the compiler is good and realizes it always returns the same string (or you generate it outside of the loop, I'm still not sure if enough as by generating it at runtime, I'm not sure he macros you usually use for regexes are effective. The macros in Julia mean, I think, that the regex is made at parse time, and my recollection is it can be important/faster, similar to |
I do think that it is a good idea to do something similar to
But I'll probably get around to it eventually, and I'm also very happy to review a pull request. I haven't looked too closely but maybe @jkrumbiegel has implemented this for ReadableRegex.jl? |
Yes, it has " |
I think there are more regex features supported here, at least last time I checked. I have an issue open in ReadableRegex for figuring out a way to merge the two packages. |
There are a lot of regex features, I did the most common ones but not the flags that change the behavior or recursion options because I hadn't used them so far. |
@jkrumbiegel I was working based on https://www.pcre.org/current/doc/html/pcre2pattern.html. I tried to implement everything it mentions, but honestly I have no idea if some of the stuff I did is correct (especially related to recursion). |
[Hi, I happened to be reading your abbreviations thread.]
I'm partial to this idea, but just as regexes in Julia are implemented by macros, I think this would also need to to be (as) fast.
Because of your package I looked more into Regexes, and discovered, the options i, s, m and more you can add after, see in docs:
I think with your package would be missing.
The text was updated successfully, but these errors were encountered: