jfz-2023-s464983/TaskD04/run.py
2023-12-11 14:00:27 +01:00

17 lines
443 B
Python

import re
#Write a program to find all maximum substrings of digits.
#Return only these substrings separated by spaces in their order.
#Do use regular expressions.
def liczby_reg(file_path):
with open(file_path, 'r', encoding='utf-8') as file:
for line in file:
number = (re.findall(r'\d+', line))
if number:
print(' '.join(number))
file_path = 'TaskD04\simple.in'
liczby_reg(file_path)