I have this regular expression for validation in javascript:
/^(?:'[A-z](([\._\-][A-z0-9])|[A-z0-9])*[a-z0-9_]*')$/
Now I want the same regular expression for the form validation using Codeigniter's form validation:
$this->form_validation->set_rules('username', 'Nombre de usuario', 'required|min_length[2]|max_length[15]|regex_match[/^[A-Z a-z 0-9 _ . \-]+$/]|is_unique[user.username]');
the regex in that line is not equivalent to the one I mentioned.
When trying to copy and paste same regex, It doesn't work. I know this is dumb i just can't seem to fully understand regular expressions.