From a9caf01342b0694c49d120fccb94f5afc9045667 Mon Sep 17 00:00:00 2001 From: Eryk Miszczuk Date: Tue, 5 Nov 2019 11:33:34 +0100 Subject: [PATCH] Task A37 --- TaskA37/run | 2 ++ TaskA37/run.py | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 TaskA37/run create mode 100644 TaskA37/run.py diff --git a/TaskA37/run b/TaskA37/run new file mode 100644 index 0000000..afa66c0 --- /dev/null +++ b/TaskA37/run @@ -0,0 +1,2 @@ +#!/bin/bash +python TaskA29/run.py "$@" diff --git a/TaskA37/run.py b/TaskA37/run.py new file mode 100644 index 0000000..cac3986 --- /dev/null +++ b/TaskA37/run.py @@ -0,0 +1,10 @@ +import sys +import re + +regex = re.compile('^((\+|0)([0-9]{2})) ([0-9]-[0-9]{3}-[0-9]{3}|[0-9]{3}-[0-9]{2}-[0-9]{2})$') + +for line in sys.stdin: + if regex.match(line.replace('\n', '')): + print(regex.match(line.replace('\n', '')).group(3)) + else: + print('')