diff --git a/TaskD04/run.py b/TaskD04/run.py new file mode 100644 index 0000000..25ebfff --- /dev/null +++ b/TaskD04/run.py @@ -0,0 +1,14 @@ +import re +import os + +def find_digits(file_path): + with open(file_path, 'r', encoding='utf-8') as file: + txt = file.read() + pattern = re.compile(r'\d+') + return pattern.findall(txt) + + + +path = os.path.join(os.path.dirname(__file__), 'simple.in') +matches = find_digits(path) +print(matches) \ No newline at end of file