Skip to content

Instantly share code, notes, and snippets.

@umanwizard
umanwizard / optional_capgroup.rs
Last active January 22, 2020 21:42
Visitor to output the list of groups that may not exist in the output
use regex::Regex;
use regex_syntax::hir::visit;
use regex_syntax::hir::Group;
use regex_syntax::hir::GroupKind;
use regex_syntax::hir::Hir;
use regex_syntax::hir::HirKind;
use regex_syntax::hir::RepetitionKind;
use regex_syntax::hir::RepetitionRange;
use regex_syntax::hir::Visitor;