Oh, yes, we need to search for the end of the string:

r'^[a-zA-Z0-9]{1,4}$'


On Sat, Aug 31, 2013 at 6:03 PM, Gerd Koetje <[email protected]>wrote:

> that still allows space,weird chars and more then 4 numbers
>
> input:
> dfdfdf565665&^^^ <http://fotuno.nl:8000/profielen/get/1/>
> got saved
>
>
>
>     def clean_profielnaam(self):
>         data = self.cleaned_data['profielnaam']
>         if not re.match(r'^[a-zA-Z0-9]{1,4}', data):
>             raise forms.ValidationError("Je mag alleen tekst en cijfers
> gebruiken en geen spaties")
>
>         return data
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to