diff --git a/zsh/dot-zshrc.d/10-workspace.sh b/zsh/dot-zshrc.d/10-workspace.sh index 5cd9731..5612083 100644 --- a/zsh/dot-zshrc.d/10-workspace.sh +++ b/zsh/dot-zshrc.d/10-workspace.sh @@ -39,15 +39,15 @@ function clone() { local url="$1" local forge owner repo - if [[ "${url}" =~ ^ssh:\/\/[a-zA-Z0-9_]+@([a-zA-Z0-9_.]+):[0-9]+/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)(.git)?$ ]]; then + if [[ "${url}" =~ ^ssh:\/\/[a-zA-Z0-9_\-]+@([a-zA-Z0-9_.\-]+):[0-9]+/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)(.git)?$ ]]; then forge="${match[1]:l}" owner="${match[2]:l}" repo="${match[3]:l}" - elif [[ "${url}" =~ ^[a-zA-Z0-9_]+@([a-zA-Z0-9_.]+):([a-zA-Z0-9_]+)\/([a-zA-Z0-9_]+)(.git)?$ ]]; then + elif [[ "${url}" =~ ^[a-zA-Z0-9_\-]+@([a-zA-Z0-9_.\-]+):([a-zA-Z0-9_\-]+)\/([a-zA-Z0-9_\-]+)(.git)?$ ]]; then forge="${match[1]:l}" owner="${match[2]:l}" repo="${match[3]:l}" - elif [[ "${url}" =~ ^https?:\/\/([a-zA-Z0-9_.]+)(:[0-9]+)?\/([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)(.git)?$ ]]; then + elif [[ "${url}" =~ ^https?:\/\/([a-zA-Z0-9_.\-]+)(:[0-9]+)?\/([a-zA-Z0-9_\-]+)/([a-zA-Z0-9_\-]+)(.git)?$ ]]; then forge="${match[1]:l}" owner="${match[3]:l}" repo="${match[4]:l}"