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
How to set regexp flags? #3355
Comments
I don't think Ruby regex supports the ungreedy flag, a lot of implementations don't, it's actually strongly discouraged. Why not just use possessive quantifiers? |
In the meantime I managed to change the regexp in such a way it works by only matching the correct string, so Ungreedy is not needed anymore. From the Website agents instruction:
|
Yeah, but that's just knowing how regex works, not exactly a uniquely Huginn problem. I'm guessing that line in the agent description was added to reduce support calls. It might be valuable to add that Huginn only supports regex mode modifiers supported by Ruby. Feel free to extend the documentation and make a PR. |
I'm asking how to set regex flags in huginn. Nothing else :) |
I need to set the ungreedy flag U but somehow it doesn't work. There are no clear instructions on how to set a flag.
In the Event Formatter Agent there is this example, which I think means A flag?
"regexp": "\A(?<time>\d\d:\d\d [AP]M [A-Z]+)",
However trying to set the U flag (in my regexp, not this example) doesn't work and the result is empty. Even the
(?U)foo
or(?U:foo)
regex modifier isn't accepted and gives an error when trying to save the agent...I tested the regexp with other tools and it works. Also, without the flag it works but is greedy.
The text was updated successfully, but these errors were encountered: