/^[a-z0-9-]+$/
To use this expression follow the code below.
//Save the expression in a variable.
$correct_slug = "/^[a-z0-9-]+$/";
//some input from a user through a text field or from a server.
$user_input = $_REQUEST['sometext'];
//match the two input's and save it in a variable.
slug_match = preg_match($correct_slug, $user_input);
//Condition goes here.
if(slug_match){
echo "Correct Input";
}
else{
echo "Incorrect Input";
}