Skip to content

Commit

Permalink
feat: Добавлена функция поиска шаблона в строке
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltRedginald committed Oct 9, 2022
1 parent 770f3a1 commit 04e2ab3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions devind_helpers/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Модуль со вспомогательными функциями."""
import re

from argparse import ArgumentTypeError
from random import choice
Expand Down Expand Up @@ -55,3 +56,8 @@ def convert_str_to_int(value: Optional[Union[str, bytes]]) -> Optional[int]:
return int(value)
except ValueError:
return None


def is_template(text: str) -> bool:
"""Поиск шаблона в строке"""
return bool(re.findall('{{ .*? }}', text))

0 comments on commit 04e2ab3

Please sign in to comment.