Coldfusion Regular Expression exclude Special Characters

Hi, I'm usesing CF8's validation in a cfinput type="text"  validate="regex" pattern="No special Characters" .....   If there are any special chracters I want to throw the error message (fails validation).  Does anyone have a pattern that allows for letters, numbers, spaces, periods, but NOT special characters?

Thanks ~ Wendi.
Who is Participating?
Todd MummertConnect With a Mentor Commented:

^[0-9a-zA-z .]+$

should work

basically beginning of string, all characters must be of the class in [], and then end of string

Todd MummertCommented:
quick follow-up ... if you want to check for any special character, use

[^0-9a-zA-z .]

which means a character not matching the group

wkolasaAuthor Commented:
Thank you!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.