I am doing this in laravel php framework. Here is the relevant part that does the validation:
$this->validate($request, [
'portrait_url' => 'required|active_url|regex:https://soundcloud.com/*',
'video_url' => 'required|active_url|regex:https://www.youtube.com/user/*',
]);
Unfortunately I get the error that says:
preg_match(): Delimiter must not be alphanumeric or backslash
I think I am not writing my regular expression well. A hint please on the right regex pattern to accomplish my purpose.
Particularly for youtube I want to verify that the entered url is the one that looks like this: https://www.youtube.com/user/OfficialSinach
the phrase OfficialSinach
could be replaced by any other username depending on the user being accessed.