From 08d83595dd729ca42ab1746bc5b7744e99eec1aa Mon Sep 17 00:00:00 2001 From: John Date: Tue, 4 Jun 2019 20:32:55 +0200 Subject: fix http/mailto regexes --- dwim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dwim b/dwim index c2a992b..bf7da16 100755 --- a/dwim +++ b/dwim @@ -22,12 +22,12 @@ my $MAILROOT = env MAILROOT => "/home/john/mail/"; our $handler; for ($phrase) { - if (/^(https?:\/\/.+)$/) { + if (/^(https?:\/?\/?.+)$/) { handle "web address"; exec "firefox", "$1" } - if (/^(mailto:\/\/.+)$/ or /^(.+@.+\.\w+)$/) { + if (/^(mailto:.+)$/ or /^(.+@.+\.\w+)$/) { handle "e-mail address"; exec @MAILER, "$1" } -- cgit v1.2.3