ValidUrl

Provides the best known regex for validating and extracting URLs.
It builds on amazing work done by Diego Perini and Mathias Bynens.
Installation
The package can be installed as:
Add
valid_url
to your list of dependencies inmix.exs
:def deps do [{:valid_url, "~> 0.1.0"}] end
Ensure
valid_url
is started before your application:def application do [applications: [:valid_url]] end
Usage
ValidUrl.validate("https://www.spencercreasey.com") # => true
ValidUrl.validate("ftp://www.example.com") # => true
ValidUrl.validate("www.google.com") # => false
Development
mix test
License
MIT
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request