MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

[SOLVED] ErrorException preg_match(): No ending delimiter ‘/’ found

I’m working on Laravel 5.8. I’m trying to use Validator to validate a name field with regex, here is my rule below:

 

But as soon as I call the rule to be validated an error is thrown, see below:
preg_match(): No ending delimiter ‘/’ found

Solution

Since regex has a pipe in it, So, we have to use an array:

$validated = $request->validate([
'url' => ['required', 'regex:/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/'],
]);

From the docs: http://laravel.com/docs/5.1/validation#rule-regex

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
With MotoShare.in, you can book a bike instantly, enjoy doorstep delivery, and ride without worries. Perfect for travelers, professionals, and adventure enthusiasts looking for a seamless mobility solution.

Related Posts

Special Characters Not Allowed Validation in Laravel 5.8

 let’s see example of laravel validation no special characters. Example -1 use this code for validation:-  ‘name’ =>  ‘required|regex:/^[a-zA-Z]+$/u’ Example:2- Use this code for validation:- ‘applyjobsforuser’ => ‘required|unique:applyjobs,applyjobsforuser’, Example-3 use this code…

Read More

Jenkins Email-ext: Add Full or Regex-Filtered Build Logs to Email Body

Learn how to include Jenkins build logs directly in notification emails using email-ext tokens. This revised guide covers full-log and regex-filtered approaches for freestyle jobs and Pipeline templates.

Read More

Jenkins Email-ext: Include Build Logs in Email Body (Full Log or Regex-Filtered)

Learn how to configure Jenkins Email Extension tokens to send either the full build log or targeted regex matches directly in the email body. This guide covers practical token examples, workflow, and pitfalls to avoid noisy or oversized alerts.

Read More

Perl Punctuation and Sigils: Practical Symbol Reference with Examples

A clear reference to the punctuation marks you see most often in Perl code, including sigils, operators, delimiters, and quote forms. Includes usage tables, example snippets, and a quick decision flow for choosing the right sigil.

Read More

Perl Training for DevOps and Build Engineers: Updated Course Guide and Curriculum

This revised guide converts an older Perl training announcement into a practical reference for engineering teams. It summarizes the course format, curriculum, tooling, lab examples, and enrollment details that should be validated before booking.

Read More

Perl Interview Questions for DevOps Engineers: Practical Concepts, Commands, and Clear Answers

A cleaned-up, interview-focused Perl guide for DevOps and SRE roles. It covers one-liners, scope rules, references, regex, module loading, and command execution with practical examples.

Read More