Jump to content


Check Chars


1 reply to this topic

#1 dEcade

    P2L Staff

  • P2L Staff
  • PipPipPipPip
  • 1,850 posts
  • Gender:Male
  • Location:Saskatoon, Saskatchewan
  • Interests:Guitar, Programming, Storm Chasing, Games (Designing and playing), Hockey, Photography

Posted 24 August 2007 - 09:41 AM

Hey guys, wasn't really sure how to go about doing this. I want a function that will return false if there are any other characters other than:

abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVQXYZ1234567890.,?

And if it is just these characters it will return true.

Thanks,
dEcade

#2 Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 24 August 2007 - 09:50 AM

if(ereg('[^A-z0-9\.,?]', 'bllllaahhhhhh123'))
{ 
	// false
	// and so on :P

Should work ;)

Edited by Matthew., 24 August 2007 - 04:29 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users