diff --git a/django/db/migrations/writer.py b/django/db/migrations/writer.py
index 68f3eb5..e9d35da 100644
--- a/django/db/migrations/writer.py
+++ b/django/db/migrations/writer.py
@@ -6,6 +6,7 @@ import decimal
 import collections
 from importlib import import_module
 import os
+import re
 import sys
 import types
 
@@ -17,6 +18,9 @@ from django.utils.encoding import force_text
 from django.utils.functional import Promise
 
 
+COMPILED_REGEX_TYPE = type(re.compile(''))
+
+
 class SettingsReference(str):
     """
     Special subclass of string which actually references a current settings
@@ -344,6 +348,17 @@ class MigrationWriter(object):
             # "()", not "(,)" because (,) is invalid Python syntax.
             format = "(%s)" if len(strings) != 1 else "(%s,)"
             return format % (", ".join(strings)), imports
+        # Compiled regex (#22943)
+        elif isinstance(value, COMPILED_REGEX_TYPE):
+            imports = set(["import re"])
+            regex_pattern, pattern_imports = cls.serialize(value.pattern)
+            regex_flags, flag_imports = cls.serialize(value.flags)
+            imports.update(pattern_imports)
+            imports.update(flag_imports)
+            args = [regex_pattern]
+            if value.flags:
+                args.append(regex_flags)
+            return "re.compile(%s)" % ', '.join(args), imports
         # Uh oh.
         else:
             raise ValueError("Cannot serialize: %r\nThere are some values Django cannot serialize into migration files.\nFor more, see https://docs.djangoproject.com/en/dev/topics/migrations/#migration-serializing" % value)
diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt
index b738d16..6c75519 100644
--- a/docs/releases/1.7.txt
+++ b/docs/releases/1.7.txt
@@ -1272,13 +1272,6 @@ Miscellaneous
   a relation from the related object back to the content type for filtering,
   ordering and other query operations.
 
-* When a model field's :attr:`~django.db.models.Field.validators` contains
-  a :class:`~django.core.validators.RegexValidator`, the regular expression
-  must now be passed as a regular expression string. You can no longer use a
-  pre-compiled regular expression in this case, as it is not serializable.
-  The :attr:`~django.core.validators.RegexValidator.flags` attribute was added
-  to :class:`~django.core.validators.RegexValidator` to simplify this change.
-
 * When running tests on PostgreSQL, the :setting:`USER` will need read access
   to the built-in ``postgres`` database. This is in lieu of the previous
   behavior of connecting to the actual non-test database.
diff --git a/tests/migrations/test_writer.py b/tests/migrations/test_writer.py
index cce0775..67915e7 100644
--- a/tests/migrations/test_writer.py
+++ b/tests/migrations/test_writer.py
@@ -2,11 +2,12 @@
 from __future__ import unicode_literals
 
 import datetime
+import re
 import os
 import tokenize
 import unittest
 
-from django.core.validators import RegexValidator, EmailValidator
+from django.core.validators import RegexValidator, EmailValidator, validate_slug
 from django.db import models, migrations
 from django.db.migrations.writer import MigrationWriter, SettingsReference
 from django.test import TestCase
@@ -104,17 +105,6 @@ class WriterTests(TestCase):
         self.assertEqual(string, repr(datetime.datetime(2014, 3, 31, 16, 4, 31)))
         self.assertEqual(imports, {'import datetime'})
         # Classes
-        validator = RegexValidator(message="hello")
-        string, imports = MigrationWriter.serialize(validator)
-        self.assertEqual(string, "django.core.validators.RegexValidator(message='hello')")
-        self.serialize_round_trip(validator)
-        validator = EmailValidator(message="hello")  # Test with a subclass.
-        string, imports = MigrationWriter.serialize(validator)
-        self.assertEqual(string, "django.core.validators.EmailValidator(message='hello')")
-        self.serialize_round_trip(validator)
-        validator = deconstructible(path="custom.EmailValidator")(EmailValidator)(message="hello")
-        string, imports = MigrationWriter.serialize(validator)
-        self.assertEqual(string, "custom.EmailValidator(message='hello')")
         # Django fields
         self.assertSerializedFieldEqual(models.CharField(max_length=255))
         self.assertSerializedFieldEqual(models.TextField(null=True, blank=True))
@@ -135,6 +125,35 @@ class WriterTests(TestCase):
             )
         )
 
+    def test_serialize_validators(self):
+        """
+        Test serialization of class-based validators, including
+        regexes.
+        """
+        validator = RegexValidator(message="hello")
+        string, imports = MigrationWriter.serialize(validator)
+        self.assertEqual(string, "django.core.validators.RegexValidator(message='hello')")
+        self.serialize_round_trip(validator)
+
+        validator = RegexValidator(regex=re.compile('^\\w+$', re.U))  # Test with a compiled regex.
+        string, imports = MigrationWriter.serialize(validator)
+        self.assertEqual(string, "django.core.validators.RegexValidator(regex=re.compile('^\\\\w+$', 32))")
+        self.serialize_round_trip(validator)
+
+        validator = validate_slug
+        string, imports = MigrationWriter.serialize(validator)
+        self.assertEqual(string, "django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+$'), \"Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.\", 'invalid')")
+        self.serialize_round_trip(validator)
+
+        validator = EmailValidator(message="hello")  # Test with a subclass.
+        string, imports = MigrationWriter.serialize(validator)
+        self.assertEqual(string, "django.core.validators.EmailValidator(message='hello')")
+        self.serialize_round_trip(validator)
+
+        validator = deconstructible(path="custom.EmailValidator")(EmailValidator)(message="hello")
+        string, imports = MigrationWriter.serialize(validator)
+        self.assertEqual(string, "custom.EmailValidator(message='hello')")
+
     def test_serialize_empty_nonempty_tuple(self):
         """
         Ticket #22679: makemigrations generates invalid code for (an empty
