Module: UrlParser
- Included in:
- UrlList
- Defined in:
- lib/phisher/url_parser.rb
Instance Method Summary collapse
-
#parse(url) ⇒ Object
Converts a url with wildcards to a regex.
Instance Method Details
#parse(url) ⇒ Object
Converts a url with wildcards to a regex
Example:
"*.google.com" to /.*\.google\.com/
8 9 10 |
# File 'lib/phisher/url_parser.rb', line 8 def parse(url) /\A#{url.gsub('/','\/').gsub('.','\.').gsub('*','.*')}\z/ end |