Sunday, 15 June 2014

validation - Laravel - Validate only letters, numbers and spaces using regex -



validation - Laravel - Validate only letters, numbers and spaces using regex -

i trying validate field made ​​up of letters, numbers , spaces in way:

$rules = array( 'field'=> 'regex:/([a-za-z0-9 ])+/' );

but if seek insert characters ' " , others, validation still has successful.

what's wrong 'in regular expression?

$rules = array( 'field'=> 'regex:/(^[a-za-z0-9 ]+$)+/' );

regex validation laravel

No comments:

Post a Comment