diff --git a/pydantic/json.py b/pydantic/json.py
--- a/pydantic/json.py
+++ b/pydantic/json.py
@@ -5,7 +5,7 @@
 from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network
 from pathlib import Path
 from types import GeneratorType
-from typing import Any, Callable, Dict, Type, Union
+from typing import Any, Callable, Dict, Pattern, Type, Union
 from uuid import UUID
 
 from .color import Color
@@ -54,6 +54,9 @@ def pydantic_encoder(obj: Any) -> Any:
     elif is_dataclass(obj):
         return asdict(obj)
 
+    if isinstance(obj, Pattern):
+        return obj.pattern
+
     # Check the class type and its superclasses for a matching encoder
     for base in obj.__class__.__mro__[:-1]:
         try:

diff --git a/tests/test_json.py b/tests/test_json.py
--- a/tests/test_json.py
+++ b/tests/test_json.py
@@ -1,5 +1,6 @@
 import datetime
 import json
+import re
 import sys
 from dataclasses import dataclass as vanilla_dataclass
 from decimal import Decimal
@@ -51,6 +52,7 @@ class MyEnum(Enum):
         (Decimal('12.34'), '12.34'),
         (create_model('BarModel', a='b', c='d')(), '{"a": "b", "c": "d"}'),
         (MyEnum.foo, '"bar"'),
+        (re.compile('^regex$'), '"^regex$"'),
     ],
 )
 def test_encoding(input, output):

Pattern type serialisation error
### Checks

* [X] I added a descriptive title to this issue
* [X] I have searched (google, github) for similar issues and couldn't find anything
* [X] I have read and followed [the docs](https://pydantic-docs.helpmanual.io/) and still think this is a bug

<!-- Sorry to sound so draconian, but every second saved replying to issues is time spend improving pydantic :-) -->

# Bug

Output of `python -c "import pydantic.utils; print(pydantic.utils.version_info())"`:
```
             pydantic version: 1.7
            pydantic compiled: True
                 install path: /root/.local/lib/python3.8/site-packages/pydantic
               python version: 3.8.6 (default, Oct 13 2020, 20:49:19)  [GCC 8.3.0]
                     platform: Linux-3.10.0-1127.19.1.el7.x86_64-x86_64-with-glibc2.2.5
     optional deps. installed: ['email-validator']
```
<!-- or if you're using pydantic prior to v1.3, manually include: OS, python version and pydantic version -->

<!-- Please read the [docs](https://pydantic-docs.helpmanual.io/) and search through issues to
confirm your bug hasn't already been reported. -->

<!-- Where possible please include a self-contained code snippet describing your bug: -->

```py
from typing import Pattern
from pydantic import BaseModel

class Model(BaseModel):
    filter: Pattern

Model(filter="^regex$").json()
```

This produce an error : 
TypeError: Object of type 'Pattern' is not JSON serializable

I had to write a custom encoder to be able to serialize properly a Pattern type : 

```py
from typing import Pattern
from pydantic import BaseModel
import re

class Model(BaseModel):
    filter: Pattern
    class Config:
        json_encoders = {
            re.Pattern: lambda v: v.pattern,
        }

Model(filter="^regex$").json()
```

tests/test_json.py::test_encoding[^regex$-"^regex$"]
tests/test_json.py::test_encoding[input0-"ebcdab58-6eb8-46fb-a190-d07a33e9eac8"] tests/test_json.py::test_encoding[input1-"192.168.0.1"] tests/test_json.py::test_encoding[input2-"black"] tests/test_json.py::test_encoding[input3-"#010c7b"] tests/test_json.py::test_encoding[input4-"**********"] tests/test_json.py::test_encoding[input5-""] tests/test_json.py::test_encoding[input6-"**********"] tests/test_json.py::test_encoding[input7-""] tests/test_json.py::test_encoding[input8-"::1:0:1"] tests/test_json.py::test_encoding[input9-"192.168.0.0/24"] tests/test_json.py::test_encoding[input10-"2001:db00::/120"] tests/test_json.py::test_encoding[input11-"192.168.0.0/24"] tests/test_json.py::test_encoding[input12-"2001:db00::/120"] tests/test_json.py::test_encoding[input13-"2032-01-01T01:01:00"] tests/test_json.py::test_encoding[input14-"2032-01-01T01:01:00+00:00"] tests/test_json.py::test_encoding[input15-"2032-01-01T00:00:00"] tests/test_json.py::test_encoding[input16-"12:34:56"] tests/test_json.py::test_encoding[input17-1036834.000056] tests/test_json.py::test_encoding[input18-[1, tests/test_json.py::test_encoding[input19-[1, tests/test_json.py::test_encoding[<genexpr>-[0, tests/test_json.py::test_encoding[this tests/test_json.py::test_encoding[input22-12.34] tests/test_json.py::test_encoding[input23-{"a": tests/test_json.py::test_encoding[MyEnum.foo-"bar"] tests/test_json.py::test_path_encoding tests/test_json.py::test_model_encoding tests/test_json.py::test_subclass_encoding tests/test_json.py::test_subclass_custom_encoding tests/test_json.py::test_invalid_model tests/test_json.py::test_iso_timedelta[input0-P12DT0H0M34.000056S] tests/test_json.py::test_iso_timedelta[input1-P1001DT1H2M3.654321S] tests/test_json.py::test_custom_encoder tests/test_json.py::test_custom_iso_timedelta tests/test_json.py::test_custom_encoder_arg tests/test_json.py::test_encode_dataclass tests/test_json.py::test_encode_pydantic_dataclass tests/test_json.py::test_encode_custom_root tests/test_json.py::test_custom_decode_encode