Responsive Advertisement

Regex pattern validation in laravel

'name' => ['required', 'regex:^[A-ZÀÂÇÉÈÊËÎÏÔÛÙÜŸÑÆŒa-zàâçéèêëîïôûùüÿñæœ0-9_.,()]+$^']


'name' => ['required', 'regex:/^[A-ZÀÂÇÉÈÊËÎÏÔÛÙÜŸÑÆŒa-zàâçéèêëîïôûùüÿñæœ0-9_.,() ]+$/']


address:{
                minlength:2,
                maxlength:500,
                regex:/^[a-zA-z,-/_=. #]+$/,
            },

protected static $rules = [
'zip_code' => 'required|regex:/\b\d{5}\b/'
];

Post a Comment

0 Comments