python-hyperscan icon indicating copy to clipboard operation
python-hyperscan copied to clipboard

Named capture groups with Chimera

Open atomikalabs opened this issue 2 years ago • 0 comments

First, thanks for all the work on this extremely useful library –

https://github.com/darvid/python-hyperscan/issues/32#issuecomment-1195994588

Regarding named capture groups, does the above approach lead to a case in which, for a pattern like b'(?<foo>ax) bx (?<bar>cx), the names foo and bar can be recovered (along with their associated content) in the match handler?

The goal would be to obtain the necessary context to create a dictionary such as

{
    "foo": "ax",
    "bar": "cx",
}

atomikalabs avatar Jan 26 '23 18:01 atomikalabs