from django.core.validators import RegexValidator class YoutubeURLValidator(RegexValidator): regex = r'https?:\/\/(((www.)?youtube.com\/((watch\?v=)|(watch\/)))|(youtu.be\/))([A-z0-9]{1,11}).+'