Regular expression

Sallu praveen.sunsetpoint at gmail.com
Fri Jun 20 07:45:22 CEST 2008


Hi All,
here i have on textbox in which i want to restrict the user to not
enter the 'acent character' like ( é )
i wrote the program

import re
value="this is Praveen"
#value = 'riché gerry'
if(re.search(r"^[A-Za-z0-9]*$",value)):
  print "Not allowed accent character"
else:
  print "Valid"

output :

sys:1: DeprecationWarning: Non-ASCII character '\xc3' in file regu1.py
on line 3, but no encoding declared; see http://www.python.org/peps/pep-0263.html
for details
Valid

when i make comment #value="this is Praveen" and released comment
value = 'riché gerry'
but still i am getting same output even it have accent character.



More information about the Python-list mailing list