From 086a27dfa373ca7bf5fc31a0e3de5f99a85df93a Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 6 Dec 2020 16:56:44 +0100 Subject: [PATCH] d04 --- TaskD04/Makefile | 0 TaskD04/run | 2 ++ TaskD04/run.py | 14 ++++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 TaskD04/Makefile create mode 100644 TaskD04/run create mode 100644 TaskD04/run.py diff --git a/TaskD04/Makefile b/TaskD04/Makefile new file mode 100644 index 0000000..e69de29 diff --git a/TaskD04/run b/TaskD04/run new file mode 100644 index 0000000..0385226 --- /dev/null +++ b/TaskD04/run @@ -0,0 +1,2 @@ +#!/bin/bash +python TaskD04/run.py "$@" \ No newline at end of file diff --git a/TaskD04/run.py b/TaskD04/run.py new file mode 100644 index 0000000..7aaa4c8 --- /dev/null +++ b/TaskD04/run.py @@ -0,0 +1,14 @@ +import re +import sys + +for line in sys.stdin: + line = re.sub(r'(\D*)([0-9]+)(\D+)([0-9]+).*', r'\1\2\3\5', line) + sys.stdout.write(line) + + + + + + + +