Skip to content

Instantly share code, notes, and snippets.

@jackdempsey
Created August 29, 2008 18:18
Show Gist options
  • Save jackdempsey/8024 to your computer and use it in GitHub Desktop.
Save jackdempsey/8024 to your computer and use it in GitHub Desktop.
LONG_RE = /^(--\w+[-\w+]*)$/
SHORT_RE = /^(-\w)$/
LONG_EQ_RE = /^(--\w+[-\w+]*)=(.*?)$|(-\w?)=(.*?)$/
SHORT_SQ_RE = /^-(\w\S+?)$/ # Allow either -x -v or -xv style for single char args
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment