Created
October 27, 2014 12:23
-
-
Save otobrglez/139dad153c7331248075 to your computer and use it in GitHub Desktop.
Regex - Anything before "cache-buster"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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