Skip to content

Instantly share code, notes, and snippets.

@charles-rumley
charles-rumley / na-number-regex.md
Last active January 31, 2017 16:31
North American Phone Number Regex

North American Phone Number Regex

\+?(\d+)?[ \.-]?\(?(\d{3})\)?[ \.-]?(\d{3})[ \.-]?(\d{4})

This regex matches most NA phone number formats without extensions, including

250-370-8517    
604-851-4700    
+12503708517    

+1232503708517

@charles-rumley
charles-rumley / 1password-vpn-login.sh
Created May 28, 2019 21:58
Use stored 1Password credentials to authenticate a Cisco AnyConnect VPN client
#!/usr/bin/env bash
# Prerequisites
#
# Download the 1Password CLI tool
#
# brew cask install 1password-cli
#
# Before using this script, you'll need to authenticate the 1Password
# CLI for the first time. Use the following command, replacing