diff --git a/pydantic/networks.py b/pydantic/networks.py
--- a/pydantic/networks.py
+++ b/pydantic/networks.py
@@ -53,7 +53,7 @@ def url_regex() -> Pattern[str]:
     global _url_regex_cache
     if _url_regex_cache is None:
         _url_regex_cache = re.compile(
-            r'(?:(?P<scheme>[a-z0-9]+?)://)?'  # scheme
+            r'(?:(?P<scheme>[a-z][a-z0-9+\-.]+)://)?'  # scheme https://tools.ietf.org/html/rfc3986#appendix-A
             r'(?:(?P<user>[^\s:]+)(?::(?P<password>\S*))?@)?'  # user info
             r'(?:'
             r'(?P<ipv4>(?:\d{1,3}\.){3}\d{1,3})|'  # ipv4

Note that according to Appendix A of [rfc2396](http://www.ietf.org/rfc/rfc2396.txt) a URI scheme is defined as:

```
scheme        = alpha *( alpha | digit | "+" | "-" | "." )
```

(search the document for "Collected BNF for URI").

Edit: [RFC3986](https://tools.ietf.org/html/rfc3986) is probably more up to date. [Appendix A](https://tools.ietf.org/html/rfc3986#appendix-A) of that document describes scheme as:

```
scheme        = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
```

In any case the `+`, `-` and `.` characters are all valid in the scheme part.
Thanks for reporting, please could you submit a PR for this?
I'll look into it. Will need to get work clearance etc tho, so it might take a little while.
Thank you, let me know if it's too much work to be worth it and/or urgent, if so I can do it.
It would require legal review, so if you didn't mind doing it, that would be very much appreciated.
wow :sleeping:, there are advantages to working for a startup.

I'll do it.
diff --git a/tests/test_networks.py b/tests/test_networks.py
--- a/tests/test_networks.py
+++ b/tests/test_networks.py
@@ -18,6 +18,10 @@
         'https://example.org/whatever/next/',
         'postgres://user:pass@localhost:5432/app',
         'postgres://just-user@localhost:5432/app',
+        'postgresql+psycopg2://postgres:postgres@localhost:5432/hatch',
+        'foo-bar://example.org',
+        'foo.bar://example.org',
+        'foo0bar://example.org',
         'https://example.org',
         'http://localhost',
         'http://localhost/',
@@ -77,6 +81,8 @@ class Model(BaseModel):
         ('abc', 'value_error.url.scheme', 'invalid or missing URL scheme', None),
         ('..', 'value_error.url.scheme', 'invalid or missing URL scheme', None),
         ('/', 'value_error.url.scheme', 'invalid or missing URL scheme', None),
+        ('+http://example.com/', 'value_error.url.scheme', 'invalid or missing URL scheme', None),
+        ('ht*tp://example.com/', 'value_error.url.scheme', 'invalid or missing URL scheme', None),
         (' ', 'value_error.any_str.min_length', 'ensure this value has at least 1 characters', {'limit_value': 1}),
         ('', 'value_error.any_str.min_length', 'ensure this value has at least 1 characters', {'limit_value': 1}),
         (None, 'type_error.none.not_allowed', 'none is not an allowed value', None),

url_regex doesn't correctly match all allowed characters in a URI
# Bug

```python
from pydantic.networks import url_regex
m=url_regex.match("postgresql+psycopg2://postgres:postgres@localhost:5432/hatch")
parts = m.groupdict()
parts
```
produces the following incorrect matching:

```python
{'scheme': None,
 'user': 'postgresql+psycopg2',
 'password': '//postgres:postgres',
 'ipv4': None,
 'ipv6': None,
 'domain': 'localhost',
 'port': '5432',
 'path': '/hatch',
 'query': None,
 'fragment': None}
```

This is with Python 3.7.5 on OSX, pydantic version 1.2




tests/test_networks.py::test_any_url_success[postgresql+psycopg2://postgres:postgres@localhost:5432/hatch] tests/test_networks.py::test_any_url_success[foo-bar://example.org] tests/test_networks.py::test_any_url_success[foo.bar://example.org]
tests/test_networks.py::test_any_url_success[http://example.org] tests/test_networks.py::test_any_url_success[http://test] tests/test_networks.py::test_any_url_success[http://localhost0] tests/test_networks.py::test_any_url_success[https://example.org/whatever/next/] tests/test_networks.py::test_any_url_success[postgres://user:pass@localhost:5432/app] tests/test_networks.py::test_any_url_success[postgres://just-user@localhost:5432/app] tests/test_networks.py::test_any_url_success[foo0bar://example.org] tests/test_networks.py::test_any_url_success[https://example.org] tests/test_networks.py::test_any_url_success[http://localhost1] tests/test_networks.py::test_any_url_success[http://localhost/] tests/test_networks.py::test_any_url_success[http://localhost:8000] tests/test_networks.py::test_any_url_success[http://localhost:8000/] tests/test_networks.py::test_any_url_success[https://foo_bar.example.com/] tests/test_networks.py::test_any_url_success[ftp://example.org] tests/test_networks.py::test_any_url_success[ftps://example.org] tests/test_networks.py::test_any_url_success[http://example.co.jp] tests/test_networks.py::test_any_url_success[http://www.example.com/a%C2%B1b] tests/test_networks.py::test_any_url_success[http://www.example.com/~username/] tests/test_networks.py::test_any_url_success[http://info.example.com?fred] tests/test_networks.py::test_any_url_success[http://info.example.com/?fred] tests/test_networks.py::test_any_url_success[http://xn--mgbh0fb.xn--kgbechtv/] tests/test_networks.py::test_any_url_success[http://example.com/blue/red%3Fand+green] tests/test_networks.py::test_any_url_success[http://www.example.com/?array%5Bkey%5D=value] tests/test_networks.py::test_any_url_success[http://xn--rsum-bpad.example.org/] tests/test_networks.py::test_any_url_success[http://123.45.67.8/] tests/test_networks.py::test_any_url_success[http://123.45.67.8:8329/] tests/test_networks.py::test_any_url_success[http://[2001:db8::ff00:42]:8329] tests/test_networks.py::test_any_url_success[http://[2001::1]:8329] tests/test_networks.py::test_any_url_success[http://[2001:db8::1]/] tests/test_networks.py::test_any_url_success[http://www.example.com:8000/foo] tests/test_networks.py::test_any_url_success[http://www.cwi.nl:80/%7Eguido/Python.html] tests/test_networks.py::test_any_url_success[https://www.python.org/\u043f\u0443\u0442\u044c] tests/test_networks.py::test_any_url_success[http://\u0430\u043d\u0434\u0440\u0435\u0439@example.com] tests/test_networks.py::test_any_url_success[https://example.com] tests/test_networks.py::test_any_url_success[https://exam_ple.com/] tests/test_networks.py::test_any_url_invalid[http:///example.com/-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[https:///example.com/-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[http://.example.com:8000/foo-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[https://example.org\\-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[https://exampl$e.org-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[http://??-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[http://.-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[http://..-value_error.url.host-URL tests/test_networks.py::test_any_url_invalid[https://example.org tests/test_networks.py::test_any_url_invalid[$https://example.org-value_error.url.scheme-invalid tests/test_networks.py::test_any_url_invalid[../icons/logo.gif-value_error.url.scheme-invalid tests/test_networks.py::test_any_url_invalid[abc-value_error.url.scheme-invalid tests/test_networks.py::test_any_url_invalid[..-value_error.url.scheme-invalid tests/test_networks.py::test_any_url_invalid[/-value_error.url.scheme-invalid tests/test_networks.py::test_any_url_invalid[+http://example.com/-value_error.url.scheme-invalid tests/test_networks.py::test_any_url_invalid[ht*tp://example.com/-value_error.url.scheme-invalid tests/test_networks.py::test_any_url_invalid[ tests/test_networks.py::test_any_url_invalid[-value_error.any_str.min_length-ensure tests/test_networks.py::test_any_url_invalid[None-type_error.none.not_allowed-none tests/test_networks.py::test_any_url_invalid[http://2001:db8::ff00:42:8329-value_error.url.extra-URL tests/test_networks.py::test_any_url_invalid[http://[192.168.1.1]:8329-value_error.url.host-URL tests/test_networks.py::test_any_url_obj tests/test_networks.py::test_http_url_success[http://example.org] tests/test_networks.py::test_http_url_success[http://example.org/foobar] tests/test_networks.py::test_http_url_success[http://example.org.] tests/test_networks.py::test_http_url_success[http://example.org./foobar] tests/test_networks.py::test_http_url_success[HTTP://EXAMPLE.ORG] tests/test_networks.py::test_http_url_success[https://example.org] tests/test_networks.py::test_http_url_success[https://example.org?a=1&b=2] tests/test_networks.py::test_http_url_success[https://example.org#a=3;b=3] tests/test_networks.py::test_http_url_success[https://foo_bar.example.com/] tests/test_networks.py::test_http_url_success[https://exam_ple.com/] tests/test_networks.py::test_http_url_invalid[ftp://example.com/-value_error.url.scheme-URL tests/test_networks.py::test_http_url_invalid[http://foobar/-value_error.url.host-URL tests/test_networks.py::test_http_url_invalid[http://localhost/-value_error.url.host-URL tests/test_networks.py::test_http_url_invalid[xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-value_error.any_str.max_length-ensure tests/test_networks.py::test_coerse_url[ tests/test_networks.py::test_coerse_url[https://www.example.com-https://www.example.com] tests/test_networks.py::test_coerse_url[https://www.\u0430\u0440\u0440\u04cf\u0435.com/-https://www.xn--80ak6aa92e.com/] tests/test_networks.py::test_coerse_url[https://exampl\xa3e.org-https://xn--example-gia.org] tests/test_networks.py::test_postgres_dsns tests/test_networks.py::test_redis_dsns tests/test_networks.py::test_custom_schemes tests/test_networks.py::test_build_url[kwargs0-ws://foo@example.net] tests/test_networks.py::test_build_url[kwargs1-ws://foo:x@example.net] tests/test_networks.py::test_build_url[kwargs2-ws://example.net?a=b#c=d] tests/test_networks.py::test_build_url[kwargs3-http://example.net:1234] tests/test_networks.py::test_son tests/test_networks.py::test_address_valid[foobar@example.com-foobar-foobar@example.com] tests/test_networks.py::test_address_valid[s@muelcolvin.com-s-s@muelcolvin.com] tests/test_networks.py::test_address_valid[Samuel tests/test_networks.py::test_address_valid[foobar tests/test_networks.py::test_address_valid[ tests/test_networks.py::test_address_valid[foo.bar@example.com tests/test_networks.py::test_address_valid[foo tests/test_networks.py::test_address_valid[FOO tests/test_networks.py::test_address_valid[<FOOBAR@example.com> tests/test_networks.py::test_address_valid[\xf1o\xf1\xf3@example.com-\xf1o\xf1\xf3-\xf1o\xf1\xf3@example.com] tests/test_networks.py::test_address_valid[\u6211\u8cb7@example.com-\u6211\u8cb7-\u6211\u8cb7@example.com] tests/test_networks.py::test_address_valid[\u7532\u6590\u9ed2\u5ddd\u65e5\u672c@example.com-\u7532\u6590\u9ed2\u5ddd\u65e5\u672c-\u7532\u6590\u9ed2\u5ddd\u65e5\u672c@example.com] tests/test_networks.py::test_address_valid[\u0447\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430\u044f\u0449\u0438\u043a-\u0441-\u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u0430\u043c\u0438.\u0440\u0444@example.com-\u0447\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430\u044f\u0449\u0438\u043a-\u0441-\u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u0430\u043c\u0438.\u0440\u0444-\u0447\u0435\u0431\u0443\u0440\u0430\u0448\u043a\u0430\u044f\u0449\u0438\u043a-\u0441-\u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u0430\u043c\u0438.\u0440\u0444@example.com] tests/test_networks.py::test_address_valid[\u0909\u0926\u093e\u0939\u0930\u0923.\u092a\u0930\u0940\u0915\u094d\u0937@domain.with.idn.tld-\u0909\u0926\u093e\u0939\u0930\u0923.\u092a\u0930\u0940\u0915\u094d\u0937-\u0909\u0926\u093e\u0939\u0930\u0923.\u092a\u0930\u0940\u0915\u094d\u0937@domain.with.idn.tld] tests/test_networks.py::test_address_valid[foo.bar@example.com-foo.bar-foo.bar@example.com] tests/test_networks.py::test_address_valid[foo.bar@exam-ple.com tests/test_networks.py::test_address_valid[\u03b9\u03c9\u03ac\u03bd\u03bd\u03b7\u03c2@\u03b5\u03b5\u03c4\u03c4.gr-\u03b9\u03c9\u03ac\u03bd\u03bd\u03b7\u03c2-\u03b9\u03c9\u03ac\u03bd\u03bd\u03b7\u03c2@\u03b5\u03b5\u03c4\u03c4.gr] tests/test_networks.py::test_address_invalid[f tests/test_networks.py::test_address_invalid[foo.bar@exam\nple.com tests/test_networks.py::test_address_invalid[foobar] tests/test_networks.py::test_address_invalid[foobar tests/test_networks.py::test_address_invalid[@example.com] tests/test_networks.py::test_address_invalid[foobar@.example.com] tests/test_networks.py::test_address_invalid[foobar@.com] tests/test_networks.py::test_address_invalid[foo tests/test_networks.py::test_address_invalid[foo@bar@example.com] tests/test_networks.py::test_address_invalid[\n@example.com] tests/test_networks.py::test_address_invalid[\r@example.com] tests/test_networks.py::test_address_invalid[\x0c@example.com] tests/test_networks.py::test_address_invalid[ tests/test_networks.py::test_address_invalid[\x1f@example.com] tests/test_networks.py::test_address_invalid["@example.com0] tests/test_networks.py::test_address_invalid["@example.com1] tests/test_networks.py::test_address_invalid[,@example.com] tests/test_networks.py::test_email_str tests/test_networks.py::test_name_email