Skip to content

Commit 890443c

Browse files
committed
reto #16 - python
1 parent 54d4955 commit 890443c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Roadmap/16 - EXPRESIONES REGULARES/python/KevinED11.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import re
22
from typing import Protocol
3-
from functools import partial
3+
from functools import partial, lru_cache
44
from enum import StrEnum
55

66

@@ -15,6 +15,7 @@ class SearchPattern(StrEnum):
1515
ALL_NUMBERS = r"\d+"
1616

1717

18+
@lru_cache
1819
def generic_searcher(pattern: str, text: str) -> IntTuple:
1920
return tuple(re.findall(pattern, text))
2021

@@ -32,6 +33,7 @@ class ValidationPattern(StrEnum):
3233
URL = r"^https?://.+$"
3334

3435

36+
@lru_cache
3537
def generic_validator(pattern: str, value: str) -> bool:
3638
return re.search(pattern, value) is not None
3739

0 commit comments

Comments
 (0)