From: Stefan Huber Date: Wed, 19 Jan 2022 09:58:58 +0000 (+0100) Subject: Major update of URL syntax highlighting X-Git-Url: https://git.sthu.org/?a=commitdiff_plain;h=b0740a654686c549d09986db4adcfc6d0bed38bf;p=mutt-gruvbox.git Major update of URL syntax highlighting --- diff --git a/colors-gruvbox-shuber.muttrc b/colors-gruvbox-shuber.muttrc index 8dd8d19..a38198a 100644 --- a/colors-gruvbox-shuber.muttrc +++ b/colors-gruvbox-shuber.muttrc @@ -62,16 +62,34 @@ color header color142 color234 "^Subject:" color header color108 color234 "^X-Spam-Status:" color header color108 color234 "^Received:" -# BSD's regex has RE_DUP_MAX set to 255. -# schema://stuff -color body color142 color234 "[a-z]{3,255}://[-a-zA-Z0-9@:%._\\+~#=/?&,;]+" -# fully qualified hostnames -color body color142 color234 "[a-zA-Z]([-a-zA-Z0-9_]+\\.){2,255}[-a-zA-Z0-9_]{2,255}" -# mail addresses +# Regex magic for URLs and hostnames +# +# Attention: BSD's regex has RE_DUP_MAX set to 255. +# +# Examples: +# http://some-service.example.com +# example.com +# a.example.com +# some-service.example.com +# example.com/ +# example.com/datenschutz +# +# Non-examples: +# 1.1.1900 +# 23.59 +# w.l.o.g +color body color142 color234 "([a-z]{3,255}://)?[[:alpha:]]\\.?([-[:alnum:]]+\\.)+[-[:alnum:]]{2,10}(/[[:graph:]]*)?" +color body color142 color234 "file:///[[:graph:]]*" + +# IPv4 and IPv6 stolen from https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses +color body color142 color234 "((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])" +color body color142 color234 "(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))" + +# Mail addresses and mailto URLs color body color208 color234 "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+" -# mailto URLS color body color208 color234 "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+" -# some simleys + +# some simleys and stuff color body color234 color214 "[;:]-*[)>(