You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 21, 2023. It is now read-only.
Function regex should return all the occurrences that satisfy the given pattern.
It seems that if we use a regex pattern that should find more then one occurence, the function only returns the first one.
Steps to reproduce the problem
create the following rule:
rule "function Regex Issue"
when
true
then
let input= "bar foo1 hello foo2";
let pattern ="(foo.)";
let field = regex(pattern, to_string(input));
set_fields(field);
end
Yes, it looks like the matcher only retrieves the first one and not all of them.
I'll need to figure out if changing that will subtly change behavior so that other patterns stop working, but I suspect it won't.
If you'd like to contribute I would like to ask to send pull requests instead of zip files. For unfortunate legal reasons we need to be able to attribute changes and require a signed contributors license agreement (which is automated via pull request on github).
The regex() function only returned a single match (similar to the Regex Extractor),
while some users require it to return all matches.
Fixes#173Closes#174
Problem description
Function regex should return all the occurrences that satisfy the given pattern.
It seems that if we use a regex pattern that should find more then one occurence, the function only returns the first one.
Steps to reproduce the problem
create the following rule:
My expected result should be:
0: foo1
1:foo2
Instead I get the only 0:foo1 group.
Environment
The text was updated successfully, but these errors were encountered: