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

doesn't match regex_to_circom #5

Closed
Divide-By-0 opened this issue Feb 12, 2023 · 2 comments
Closed

doesn't match regex_to_circom #5

Divide-By-0 opened this issue Feb 12, 2023 · 2 comments

Comments

@Divide-By-0
Copy link
Member

For the header regex, this command yarn compile '(\r\n|\x80)(to|from):((a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9| |_|.|"|@|-)+<)?(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9|_|.|-)+@(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9|_|.|-)+>?\r\n' doesn't match the output from regex_to_circom. Here, it wrongly asserts that there are 3 accept states, but in the python + js version, it has 1 accept state and passes.

@katat
Copy link
Contributor

katat commented Feb 13, 2023

This PR should cover the fix to this. I haven't run a test for this case yet, so let me know if it works.

Keep in mind the out representing the number of accepted states is renamed to entire_count, while the group_match_count is representing the number of matches for a specific alternative group in the regex. I am writing a readme to outline the usages so people don't get confused.

Meanwhile, the test cases in the code should imply the ins and outs.

@Divide-By-0
Copy link
Member Author

Great! Looking forward to seeing those changes in the README/comments/documentation.

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

No branches or pull requests

2 participants