Regular

 avatar
user_5119020710
python
2 years ago
357 B
2
Indexable
Never
import re
filename=input()
fileData = open(filename, "r")
stringData = fileData.read()
results = re.sub(r'(\s{2,})', ' ', stringData)
print(results)

import re
filename=input()
fileData = open(filename, "r")
stringData = fileData.read()

results = re.findall(r'ISBN\s\d{1,5}-\d{3}-\d{5}-\d{1}', stringData)
if results:
    for i in results:
        print(i)