Welcome Guest, Not a member yet? Register   Sign In
Regular Expression test or form validation for login
#1

[eluser]quibstar[/eluser]
I'm trying to have my login require at least one number, special character. But I don't see any way to use regular expression or form validation to accomplish this.
#2

[eluser]whobutsb[/eluser]
[quote author="quibstar" date="1262898363"]I'm trying to have my login require at least one number, special character. But I don't see any way to use regular expression or form validation to accomplish this.[/quote]

I'm not a RegExp whiz but you can check out this tutorial for more info on Regular expressions.


As for the validation you can use callbacks

Code:
function myfunction(){

    $this->load->library('form_validation');

    $this->form_validation->set_rules('username', 'Username', 'callback_username_check');
    
    if(!$this->form_validation->run()){
        //Failed
        return;
    }
    
    //Success
    
}


function username_check($username){
    
    //Run your regexp function here
    
    //Return TRUE or FALSE
    
}




Theme © iAndrew 2016 - Forum software by © MyBB