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/'
];
x
'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/'
];
0 comments:
Post a Comment
Thanks