{"id":20,"date":"2021-01-05T05:28:26","date_gmt":"2021-01-05T05:28:26","guid":{"rendered":"https:\/\/professnow.com\/blog\/?p=20"},"modified":"2021-01-05T05:59:39","modified_gmt":"2021-01-05T05:59:39","slug":"solved-errorexception-preg_match-no-ending-delimiter-found","status":"publish","type":"post","link":"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/","title":{"rendered":"[SOLVED] ErrorException preg_match(): No ending delimiter &#8216;\/&#8217; found"},"content":{"rendered":"\n<p>I\u2019m working on Laravel 5.8. I\u2019m trying to use Validator to validate a name field with regex, here is my rule below:<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/SushantSinghRajput03\/69fba4bd07bd3300040e436f5e292014.js\"><\/script>\n\n\n\n<p>But as soon as I call the rule to be validated an error is thrown, see below:<br><strong>preg_match(): No ending delimiter \u2018\/\u2019 found<\/strong><\/p>\n\n\n\n<h1 class=\"has-text-align-center wp-block-heading\"><strong>Solution<\/strong><\/h1>\n\n\n\n<p>Since regex has a pipe in it, So, we have to use an array:<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/SushantSinghRajput03\/98254383986a6ec105d5b576baf3d436.js\"><\/script>\n\n\n\n<p>From the docs:&nbsp;<a href=\"http:\/\/laravel.com\/docs\/5.8\/validation#rule-regex\" data-type=\"URL\" data-id=\"http:\/\/laravel.com\/docs\/5.8\/validation#rule-regex\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/laravel.com\/docs\/5.8\/validation#rule-regex<\/a><\/p>\n\n\n\n<p>That\u2019s All.<\/p>\n\n\n\n<p>Thanks for Reading.<\/p>\n\n\n\n<p>Keep Coding.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"300\" src=\"https:\/\/professnow.com\/blog\/wp-content\/uploads\/2021\/01\/Keep_coding.gif\" alt=\"\" class=\"wp-image-26\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019m working on Laravel 5.8. I\u2019m 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 \u2018\/\u2019 found Solution Since regex has a pipe in it, So, we have [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[8,21],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-laravel","tag-laravel","tag-laravel-regex"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[SOLVED] ErrorException preg_match(): No ending delimiter &#039;\/&#039; found - ProfessNow<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[SOLVED] ErrorException preg_match(): No ending delimiter &#039;\/&#039; found - ProfessNow\" \/>\n<meta property=\"og:description\" content=\"I\u2019m working on Laravel 5.8. I\u2019m 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 \u2018\/\u2019 found Solution Since regex has a pipe in it, So, we have [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/\" \/>\n<meta property=\"og:site_name\" content=\"ProfessNow\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-05T05:28:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-05T05:59:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/professnow.com\/blog\/wp-content\/uploads\/2021\/01\/Keep_coding.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"author\" content=\"Sushant Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sushant Kumar\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/\"},\"author\":{\"name\":\"Sushant Kumar\",\"@id\":\"https:\/\/professnow.com\/blog\/#\/schema\/person\/0129748fa0821f3e6efc636c6777b9d3\"},\"headline\":\"[SOLVED] ErrorException preg_match(): No ending delimiter &#8216;\/&#8217; found\",\"datePublished\":\"2021-01-05T05:28:26+00:00\",\"dateModified\":\"2021-01-05T05:59:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/\"},\"wordCount\":87,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/professnow.com\/blog\/wp-content\/uploads\/2021\/01\/Keep_coding.gif\",\"keywords\":[\"laravel\",\"laravel-regex\"],\"articleSection\":[\"Laravel\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/\",\"url\":\"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/\",\"name\":\"[SOLVED] ErrorException preg_match(): No ending delimiter '\/' found - ProfessNow\",\"isPartOf\":{\"@id\":\"https:\/\/professnow.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/professnow.com\/blog\/wp-content\/uploads\/2021\/01\/Keep_coding.gif\",\"datePublished\":\"2021-01-05T05:28:26+00:00\",\"dateModified\":\"2021-01-05T05:59:39+00:00\",\"author\":{\"@id\":\"https:\/\/professnow.com\/blog\/#\/schema\/person\/0129748fa0821f3e6efc636c6777b9d3\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/#primaryimage\",\"url\":\"https:\/\/professnow.com\/blog\/wp-content\/uploads\/2021\/01\/Keep_coding.gif\",\"contentUrl\":\"https:\/\/professnow.com\/blog\/wp-content\/uploads\/2021\/01\/Keep_coding.gif\",\"width\":300,\"height\":300},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/professnow.com\/blog\/#website\",\"url\":\"https:\/\/professnow.com\/blog\/\",\"name\":\"ProfessNow\",\"description\":\"Find Verified Professionals Near You\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/professnow.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/professnow.com\/blog\/#\/schema\/person\/0129748fa0821f3e6efc636c6777b9d3\",\"name\":\"Sushant Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/professnow.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/092cd9bf0832fe9aa2450955f90b56545e8f7b54e08173f584c5130ad01df057?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/092cd9bf0832fe9aa2450955f90b56545e8f7b54e08173f584c5130ad01df057?s=96&d=mm&r=g\",\"caption\":\"Sushant Kumar\"},\"url\":\"https:\/\/professnow.com\/blog\/author\/raja\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[SOLVED] ErrorException preg_match(): No ending delimiter '\/' found - ProfessNow","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/","og_locale":"en_US","og_type":"article","og_title":"[SOLVED] ErrorException preg_match(): No ending delimiter '\/' found - ProfessNow","og_description":"I\u2019m working on Laravel 5.8. I\u2019m 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 \u2018\/\u2019 found Solution Since regex has a pipe in it, So, we have [&hellip;]","og_url":"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/","og_site_name":"ProfessNow","article_published_time":"2021-01-05T05:28:26+00:00","article_modified_time":"2021-01-05T05:59:39+00:00","og_image":[{"width":300,"height":300,"url":"https:\/\/professnow.com\/blog\/wp-content\/uploads\/2021\/01\/Keep_coding.gif","type":"image\/gif"}],"author":"Sushant Kumar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sushant Kumar"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/#article","isPartOf":{"@id":"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/"},"author":{"name":"Sushant Kumar","@id":"https:\/\/professnow.com\/blog\/#\/schema\/person\/0129748fa0821f3e6efc636c6777b9d3"},"headline":"[SOLVED] ErrorException preg_match(): No ending delimiter &#8216;\/&#8217; found","datePublished":"2021-01-05T05:28:26+00:00","dateModified":"2021-01-05T05:59:39+00:00","mainEntityOfPage":{"@id":"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/"},"wordCount":87,"commentCount":0,"image":{"@id":"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/#primaryimage"},"thumbnailUrl":"https:\/\/professnow.com\/blog\/wp-content\/uploads\/2021\/01\/Keep_coding.gif","keywords":["laravel","laravel-regex"],"articleSection":["Laravel"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/","url":"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/","name":"[SOLVED] ErrorException preg_match(): No ending delimiter '\/' found - ProfessNow","isPartOf":{"@id":"https:\/\/professnow.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/#primaryimage"},"image":{"@id":"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/#primaryimage"},"thumbnailUrl":"https:\/\/professnow.com\/blog\/wp-content\/uploads\/2021\/01\/Keep_coding.gif","datePublished":"2021-01-05T05:28:26+00:00","dateModified":"2021-01-05T05:59:39+00:00","author":{"@id":"https:\/\/professnow.com\/blog\/#\/schema\/person\/0129748fa0821f3e6efc636c6777b9d3"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/professnow.com\/blog\/solved-errorexception-preg_match-no-ending-delimiter-found\/#primaryimage","url":"https:\/\/professnow.com\/blog\/wp-content\/uploads\/2021\/01\/Keep_coding.gif","contentUrl":"https:\/\/professnow.com\/blog\/wp-content\/uploads\/2021\/01\/Keep_coding.gif","width":300,"height":300},{"@type":"WebSite","@id":"https:\/\/professnow.com\/blog\/#website","url":"https:\/\/professnow.com\/blog\/","name":"ProfessNow","description":"Find Verified Professionals Near You","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/professnow.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/professnow.com\/blog\/#\/schema\/person\/0129748fa0821f3e6efc636c6777b9d3","name":"Sushant Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/professnow.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/092cd9bf0832fe9aa2450955f90b56545e8f7b54e08173f584c5130ad01df057?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/092cd9bf0832fe9aa2450955f90b56545e8f7b54e08173f584c5130ad01df057?s=96&d=mm&r=g","caption":"Sushant Kumar"},"url":"https:\/\/professnow.com\/blog\/author\/raja\/"}]}},"_links":{"self":[{"href":"https:\/\/professnow.com\/blog\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/professnow.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/professnow.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/professnow.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/professnow.com\/blog\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":12,"href":"https:\/\/professnow.com\/blog\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":37,"href":"https:\/\/professnow.com\/blog\/wp-json\/wp\/v2\/posts\/20\/revisions\/37"}],"wp:attachment":[{"href":"https:\/\/professnow.com\/blog\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/professnow.com\/blog\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/professnow.com\/blog\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}