mirror of
https://github.com/fabriziosalmi/patterns.git
synced 2025-12-17 09:45:34 +00:00
Merge pull request #11 from fabriziosalmi/codeflash/optimize-validate_regex-m6xp4bpf
⚡️ Speed up function `validate_regex` by 2,003%
This commit is contained in:
commit
870da8e1c9
@ -37,6 +37,7 @@ def load_owasp_rules(file_path):
|
||||
raise
|
||||
|
||||
|
||||
@lru_cache(maxsize=None)
|
||||
def validate_regex(pattern):
|
||||
"""Validate if a pattern is a valid regex."""
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user