Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[py3] Fixed slug regex

In Python 3, \w matches any Unicode character.
  • Loading branch information...
commit 2b157b0adc5cbe4fb0161f8319aca809b32eeae0 1 parent 60f5e10
Claude Paroz authored August 15, 2012

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  django/core/validators.py
2  django/core/validators.py
@@ -99,7 +99,7 @@ def __call__(self, value):
99 99
     r'|\[(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\]$', re.IGNORECASE)  # literal form, ipv4 address (SMTP 4.1.3)
100 100
 validate_email = EmailValidator(email_re, _('Enter a valid e-mail address.'), 'invalid')
101 101
 
102  
-slug_re = re.compile(r'^[-\w]+$')
  102
+slug_re = re.compile(r'^[-a-zA-Z0-9_]+$')
103 103
 validate_slug = RegexValidator(slug_re, _("Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens."), 'invalid')
104 104
 
105 105
 ipv4_re = re.compile(r'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$')

0 notes on commit 2b157b0

Please sign in to comment.
Something went wrong with that request. Please try again.