Skip to content

Caching compiled re patternsΒ #108

@pvarsh

Description

@pvarsh

First of all, thank you for creating this Python port.

In my use, I'm checking a large number of short strings to see if they are likely to be a phone number. I found that I'm making a lot of calls to re.compile() (for example here). Caching the patterns leads to about a 6-10x speedup for my use case.

If this is something that would make sense given the contributing guidelines, I'd be happy to do a PR.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions