Hey all! I have a question that I just need a real solid answer to ;) Basically, I need a PHP script that checks values inputted by a form for special characters (only allows letters, numbers, and apostrophes). For form validation :D. I'm really not the best with regexes otherwise I would figure it out, but I've spent a lot of time searching this and haven't been able to find it. Please help!!! Thanks a ton!
jeffc418
0
Junior Poster in Training
Recommended Answers
Jump to Post[0-9a-zA-Z\']+
Jump to Post+ means 1 or more
* means 0 or more#^[a-z\' -]*$#i
The following needs exactly 4 of the specified characters
#^[a-z\' -]{4}$#i
All 5 Replies
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
jeffc418
0
Junior Poster in Training
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
jeffc418
0
Junior Poster in Training
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.