Skip to content

Instantly share code, notes, and snippets.

@acuppy
Created July 21, 2013 04:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acuppy/6047507 to your computer and use it in GitHub Desktop.
Save acuppy/6047507 to your computer and use it in GitHub Desktop.
Remote URL (ex: http://example.com) and Local URL (ex: C:\\path\to\file or /path/to/file.txt)
REMOTE_URL_PATTERN = /\A(?:(?:http|https):\/\/[a-z0-9]+(?:[\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(?:\:[0-9]{1,5})?).*\z/ix
LOCAL_URL_PATTERN = /\A(?:[a-zA-Z]{1,2}\:\\\\?).*\z/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment