Parse dot as period, not character wildcard

This commit is contained in:
Anders Damsgaard 2018-12-19 10:32:00 +01:00
parent ca12ed28a5
commit 69296d87d7

View file

@ -14,7 +14,7 @@ if [ "$choice" = "🦆" ]; then
$browser "https://duckduckgo.com" $browser "https://duckduckgo.com"
else else
# Detect if url # Detect if url
if [[ "$choice" =~ ^(http:\/\/|https:\/\/)?[a-zA-Z0-9]+.[a-zA-Z]+(/)?.*$ ]]; then if [[ "$choice" =~ ^(http:\/\/|https:\/\/)?[a-zA-Z0-9]+\.[a-zA-Z]+(/)?.*$ ]]; then
$browser "$choice" $browser "$choice"
else else
$browser "https://duckduckgo.com/?q=$choice&t=ffab&atb=v1-1" $browser "https://duckduckgo.com/?q=$choice&t=ffab&atb=v1-1"