From 1f04c93c90cb44c805040def751d2753a7f16f29 Mon Sep 17 00:00:00 2001 From: Robert May Date: Mon, 28 Jun 2021 16:18:00 +0100 Subject: Modify regex to prevent partial matches --- internal/command/commandargs/shell.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/command/commandargs/shell.go') diff --git a/internal/command/commandargs/shell.go b/internal/command/commandargs/shell.go index 9cf6720..589f58d 100644 --- a/internal/command/commandargs/shell.go +++ b/internal/command/commandargs/shell.go @@ -20,8 +20,8 @@ const ( ) var ( - whoKeyRegex = regexp.MustCompile(`\bkey-(?P\d+)\b`) - whoUsernameRegex = regexp.MustCompile(`\busername-(?P\S+)\b`) + whoKeyRegex = regexp.MustCompile(`\Akey-(?P\d+)\z`) + whoUsernameRegex = regexp.MustCompile(`\Ausername-(?P\S+)\z`) ) type Shell struct { -- cgit v1.2.1