Check a variable using regex

ancuh0

New Member
Im about to create a registration form for my website. I need to check the variable, and accept it only if contains letter, number, _ or -.How can do it with regex? I used to work with them with \[code\]preg_replace()\[/code\], but i think this is not the case. Also, i know that the "ereg" function is dead. Any solutions?
 
Back
Top