jfz-2023-s473564/TaskD04/run.py

13 lines
355 B
Python
Raw Permalink Normal View History

2023-11-27 14:34:07 +01:00
import re
def find_all_digit_substrings(file_path):
with open(file_path, 'r') as file:
lines = file.readlines()
for line in lines:
digit_substrings = re.findall(r'\d+', line)
if digit_substrings:
print(' '.join(digit_substrings))
file_path = './simple.in'
find_all_digit_substrings(file_path)