cihan
(Cihan Goekgoez)
1
Hi there
I need a custom regularexpression validation for username validation.
the validation is the same like a email adress validation except the requiremnt of a "@" -symbol and a toplevel check.
i need a regexp validation which checks whitespaces special charecters etc.
Can somebody help?
thanks!
cihan
abennouna
(Abennouna)
2
Hello
I’m using this one
array('username', 'match', 'pattern' => '/^[A-Za-z0-9_]+$/u'),
It allows only alphanumeric characters in addition to underscore
pasim
(Janis Janovskis)
4
You can aslo supply error message, like this;
<?php
array('path', 'match' ,'pattern'=>'/^[a-z0-9_-]+\.[a-z]+$/i', 'message'=>'Field can contain only alphanumeric characters and hyphens(-).')
?>