Let's say I have a form field for "Name". I want to display an error message if it contains special characters such as $,#,etc. The only acceptable characters should be any alphanumeric, the hyphen "-", and the apostrophe "'". I am not sure how i should search the name for these non-acceptable characters, especially the apostrophe. So in the code it should look like the following:
name = request.POST['name']
if name contains any non-acceptable characters then display error message.