I'm trying to check if a sentence contains the special character |
or ]
using Laravel/Lumen validation in the controller like below:
'to_address' => 'required|max:200|regex:/^[^(|]~`!%^&*=};:?><’)]*$/',
If I user this validation on my controller, I'm getting the following error
{
"error": "preg_match(): No ending delimiter '/' found"
}
Without |
and ]
the validation is working correctly.