ex D
This commit is contained in:
parent
abd0e8fd7f
commit
6b3df7cf2b
|
@ -0,0 +1,7 @@
|
|||
import re
|
||||
import sys
|
||||
|
||||
for line in sys.stdin:
|
||||
stripped_line = line.strip()
|
||||
if re.search("Hamlet", stripped_line):
|
||||
print(stripped_line)
|
|
@ -0,0 +1,2 @@
|
|||
Here comes Hamlet
|
||||
Hamlet Hamlet again
|
|
@ -0,0 +1,7 @@
|
|||
import re
|
||||
import sys
|
||||
|
||||
for line in sys.stdin:
|
||||
stripped_line = line.strip()
|
||||
if re.search(r"\bpies\b", stripped_line, re.IGNORECASE):
|
||||
print(stripped_line)
|
|
@ -0,0 +1,3 @@
|
|||
Pies ma Alę
|
||||
Kot i pies to zwierzęta
|
||||
pies
|
|
@ -0,0 +1,7 @@
|
|||
import re
|
||||
import sys
|
||||
|
||||
for line in sys.stdin:
|
||||
stripped_line = line.strip()
|
||||
if re.search("19[0-9][0-9] r\.", stripped_line, re.IGNORECASE):
|
||||
print(stripped_line)
|
|
@ -0,0 +1,3 @@
|
|||
Kiedyś był 1934 r.
|
||||
Kiedyś był 1934 r.fsdfsdfsdf
|
||||
1934 r. to jakaś data
|
|
@ -0,0 +1,10 @@
|
|||
import re
|
||||
import sys
|
||||
|
||||
for line in sys.stdin:
|
||||
stripped_line = line.strip()
|
||||
if re.search("\d+", stripped_line):
|
||||
sub = re.findall("\d+", stripped_line)
|
||||
print(' '.join(sub))
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
34234 34 5
|
||||
34535
|
||||
34
|
||||
1992 1999
|
Loading…
Reference in New Issue