[Fixed]-Django Form validate arabic CharField

1👍

There a couple of issues with that check line, first the Regex should be reversed like (you may want to add _-):

if re.findall(u'[^\u0627-\u064a\W]', fullname_arabic, flags=re.UNICODE)

also notice r' is replaced by u', because \u0628 won’t be interpreted wi r'

Edit: From a previous project of mine, the Arabic range should be changed to \u0621-\u06ED

👤ahmed

Leave a comment