Zadanie 46
This commit is contained in:
parent
fa142f084c
commit
d85b2eaa7b
18
TaskC46/C46.py
Normal file
18
TaskC46/C46.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def line_contains_correct_path(line):
|
||||||
|
if re.findall("^\/(\w+\/)+([\w|\.|\-]*)", line, re.DOTALL) and len(
|
||||||
|
re.search("^\/(\w+\/)+([\w|\.|\-]*)", line, re.DOTALL)[0]) > 1:
|
||||||
|
return re.findall("^\/(\w+\/)+([\w|\.|\-]*)", line, re.DOTALL)[0][1]
|
||||||
|
elif re.findall("^(\w:\\\)(\w+\\\)*([\w|\.|\-]*)$", line) and len(
|
||||||
|
re.findall("^(\w:\\\)(\w+\\\)*([\w|\.|\-]*)$", line)[0]) > 2:
|
||||||
|
return re.findall("^(\w:\\\)(\w+\\\)*([\w|\.|\-]*)$", line)[0][2]
|
||||||
|
|
||||||
|
|
||||||
|
for line in sys.stdin:
|
||||||
|
if line_contains_correct_path(line):
|
||||||
|
print(line_contains_correct_path(line).rstrip('\n'))
|
||||||
|
else:
|
||||||
|
print("<NONE>")
|
0
TaskC46/Makefile
Normal file
0
TaskC46/Makefile
Normal file
2
TaskC46/run
Executable file
2
TaskC46/run
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
python3 TaskC46/C46.py "$@"
|
Loading…
Reference in New Issue
Block a user