Skip to content

Instantly share code, notes, and snippets.

@otobrglez
Created October 27, 2014 12:23
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 otobrglez/139dad153c7331248075 to your computer and use it in GitHub Desktop.
Save otobrglez/139dad153c7331248075 to your computer and use it in GitHub Desktop.
Regex - Anything before "cache-buster"
# Regular expression that
# 1. Finds host name
# 2. Finds path name
# 3. Ignores first optional numeric 'cache-buster' parameter
xp = %r{^http:\/\/([a-z0-9\.]+)\/([a-z_]+)\/(.*?)(?:\?|$)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment