From b89205fdc6e784d2ef7abbe20428c7aca2a1485f Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Wed, 2 Dec 2020 16:50:19 +0100 Subject: [PATCH] Fix regex --- 2/1/main.go | 2 +- 2/2/main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/2/1/main.go b/2/1/main.go index 286fbde..312dbc0 100644 --- a/2/1/main.go +++ b/2/1/main.go @@ -40,7 +40,7 @@ func main() { passwords := []*password{} - inputRegex := regexp.MustCompile(`(?m)^(\d+)-(\d+) (\w): (\w+)$`) + inputRegex := regexp.MustCompile(`^(\d+)-(\d+) (\w): (\w+)$`) scanner := bufio.NewScanner(file) for scanner.Scan() { diff --git a/2/2/main.go b/2/2/main.go index 9c5b1c2..e3096c5 100644 --- a/2/2/main.go +++ b/2/2/main.go @@ -33,7 +33,7 @@ func main() { passwords := []*password{} - inputRegex := regexp.MustCompile(`(?m)^(\d+)-(\d+) (\w): (\w+)$`) + inputRegex := regexp.MustCompile(`^(\d+)-(\d+) (\w): (\w+)$`) scanner := bufio.NewScanner(file) for scanner.Scan() {