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

Expose match groups #65

Open
Divide-By-0 opened this issue Jul 7, 2024 · 1 comment
Open

Expose match groups #65

Divide-By-0 opened this issue Jul 7, 2024 · 1 comment
Labels
enhancement New feature or request high

Comments

@Divide-By-0
Copy link
Member

Divide-By-0 commented Jul 7, 2024

Allow anyone to index regex matched groups as they normally would, map that to the relevant ispublic/isprivate states, then expose that automatically.

This will be needed for good UX and Javascript dev compatibility.

@Divide-By-0 Divide-By-0 added enhancement New feature or request high labels Jul 7, 2024
@brolag
Copy link

brolag commented Aug 23, 2024

Proposal for Implementing Match Group Exposure in ZK Regex Circuits

  • Implement a new function in packages/compiler/src/regex.rs:

    fn parse_regex_with_match_groups(regex: &str, public_groups: &[String]) -> DecomposedRegexConfig
  • Update genFromDecomposed in packages/compiler/src/wasm.rs to accept regex with groups:

    pub fn genFromDecomposed(regex: &str, public_groups: &[String], circomTemplateName: &str) -> String
  • Modify process_public_regex in packages/compiler/src/regex.rs to handle group structure.

  • Add tests in packages/circom/tests/ for the new functionality.

  • Update CLI in packages/compiler/src/main.rs to support the new input format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high
Projects
None yet
Development

No branches or pull requests

2 participants