Skip to content

Instantly share code, notes, and snippets.

@maxerickson
Last active February 21, 2022 22:12
Show Gist options
  • Save maxerickson/33be21d724d37e17d9a069ae62b5bb73 to your computer and use it in GitHub Desktop.
Save maxerickson/33be21d724d37e17d9a069ae62b5bb73 to your computer and use it in GitHub Desktop.
Format Phone Number
#!/bin/bash
# use with Clipman
# Pattern: (?!\+1 \d{3} \d{3} \d{4}).{0,9}(\d{3}).{0,5}(\d{3}).{0,5}(\d{4}).{0,5}
# Command: /opt/formatphone.sh "+1 \1 \2 \3"
echo -n $1 | xclip -in -selection clipboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment