Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
532 B
14
Indexable
Never
cau 1

import re
fileName = input()
file = open(fileName,'r')
    for line in file:
        t = re.findall(r"ISBN\s\d{1,5}-\d{3}-\d{5}-\d",line)
        if t:
            for p in t:
                print(p)



cau 2

import re
fileName = input()
file = open(fileName,'r')
for line in file:
    print(re.sub(r"\s+", " ", line))



cau 3

import re
fileName = input()
file = open(fileName,'r')
    for line in file:
        t = re.findall(r"\(\+?84\)[789][0-9]{8}",line)
        if t:
            for p in t:
                print(p)