I would like to create a preg_match function to validate my passowrds, but I\'m not sure how to write it to allow the following special characters to be used: <
I've done this with my drupal custom form in hook_form_validate here the password should be 6 characters of letters, numbers and at least one special character.
if (!preg_match('/^(?=.*\d)(?=.*[A-Za-z])(?=.*[!@#$%])[0-9A-Za-z!@#$%]{6,15}$/', $form_state['values']['pass'])) {
form_set_error('pass', t('Password must contain 6 characters of letters, numbers and at least one special character.'));
}
?>