Skip to content

Build & evaluate pure python regex filter #235

Description

@masklinn

FilteredRE2 (and regex-filtered) show amazing results on ua-parser work load, however if for some reason they're not available (or they're missed) users are stuck with the horror show that is sequential regex matching.

regex filtering should be reimplemented for the stdlib's re module in order to see how it behaves and if the gain is as significant as it is for the native regexes. The big question will be how efficient a pure python aho-corasick is (possibly via ahocorapy?)

Activity

  1. masklinn commented on Aug 16, 2025

    @masklinn
    ContributorAuthor

    See prior art at https://github.com/ua-parser/uap-rust/tree/main/regex-filtered

    Do take note of ua-parser/uap-rust@4f1c7df and ua-parser/uap-rust@f500c57

    An other core concern will be the implementation of aho-corasick in Python, uap-rust was able to use https://github.com/BurntSushi/aho-corasick but a third-party dependency would be a bigger concern here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions