Skip to content
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

fix(parser): Fixed parsing of empty alternation groups (#193) #247

Merged
merged 1 commit into from
Jun 12, 2023

Conversation

metthal
Copy link
Member

@metthal metthal commented Jun 12, 2023

This fixes parsing of regexes like /(a|b|)/ which are valid YARA but we weren't able to handle empty alternation groups. Fixes #193.

@metthal metthal changed the title fix(parser): Fixed parsing of empty alternation groups fix(parser): Fixed parsing of empty alternation groups (#193) Jun 12, 2023
@metthal metthal requested a review from MatejKastak June 12, 2023 14:11
Copy link
Member

@MatejKastak MatejKastak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

I also tested and it is also accepted by YARA.

rule asd {
    strings:
        $1 = /(a|||||)/ 
    condition:
        $1
}

@metthal metthal merged commit 45b82b2 into master Jun 12, 2023
8 checks passed
@metthal metthal deleted the fix/empty-alt-group branch June 12, 2023 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regular expression idiom (a|b|) accepted by yara but not yaramod
2 participants