I have this regex pattern:
/^[\p{L}\p{M}\p{N}\d\s\,-]+$/u
.
When I try to validate any string for topics which can hold ü,ö,ä,ə,ç...
with Laravel's Validator then it doesn't match. But when I use this regex outside of Laravel's Validator then it works as expected.
This is my validator function:
$validator = Validator::make($request->all(), [
'type' => 'required',
'internal_name' => 'required|min:3|max:255|unique:news',
'topics' => 'max:255|regex:/^[\p{L}\p{M}\p{N}\d\s\,-]+$/u', <--- here is the problem
'description' => 'required',
'body' => 'required'
]);
I have searched if there is any problem with Laravel, but couldn't find anything.