{"id":3040,"date":"2017-07-14T09:46:22","date_gmt":"2017-07-14T09:46:22","guid":{"rendered":"http:\/\/cloudkul.com\/blog\/?p=3040"},"modified":"2017-07-18T05:02:11","modified_gmt":"2017-07-18T05:02:11","slug":"demystifying-regular-expression","status":"publish","type":"post","link":"https:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/","title":{"rendered":"Demystifying The Regular Expressions \u2013 I"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><b><\/b>Doesn&#8217;t matter even if you are a ninja programmer or a novice, at a point in life, you got to master regular expression. Therefore, the sooner the better.<\/p>\n<p>So, let\u2019s get started.<\/p>\n<p>Many people refer to call regular expression as <span style=\"color: #000000\"><b>Regex<\/b><\/span>,<span style=\"color: #000000\"> <b>Regexp<\/b><\/span> or simple <span style=\"color: #000000\"><b>Regular expression<\/b><\/span>. All means the same. Regex is a pattern that consists of rules used to match a certain set of strings. For example, we can write the names (three bold words above) in a regex form like this<\/p>\n<p>&nbsp;<\/p>\n<p>\/<span style=\"color: #008080\"><b>^<\/b><b>Reg(exp?|ular expression)<\/b><\/span><b><span style=\"color: #008080\">$<\/span>\/<\/b><\/p>\n<p>&nbsp;<\/p>\n<p>A more abstract definition would be, &#8220;regex is a way to describe a set strings&#8221;. Now the more pressing question is why regex are useful or should you use regex at all?<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>Regex are extremely fast, provided you write a good regex, not a sloppy one.<\/li>\n<li>Regex can help you to write short codes.<\/li>\n<li>Regex saves a lot of time.<\/li>\n<li>Regex can match about anything.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>We can check if a string matches a certain format, like in HTML5, we can use it in form validation. We can use it to extract certain parts of the string or replace, depends on your need. Regex capabilities are built-in in many programming languages, IDEs, command line tools like grep, sed, etc.; And also with databases. Regex are used in search engine.<\/p>\n<p>&nbsp;<\/p>\n<p>One limitation of regex would be that, they are not fully portable, means regex written for ruby might not work with PHP. This is due to the different regex engines (PCRE, Jregex, XregExp).<\/p>\n<p>&nbsp;<\/p>\n<p>Now let&#8217;s dive into regex basic:<\/p>\n<ul>\n<li>The most basic regex is which contain letters, numbers and other symbols that literally matches Itself. For example \u2018<span style=\"color: #ff0000\">a<\/span>\u2019 is a regex to match symbols \u2018<span style=\"color: #ff0000\">a<\/span>\u2019.<\/li>\n<li>By default regex are case sensitive.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000\"><b>Common Matching Symbols<\/b><\/span><\/p>\n<p><span style=\"color: #000000\"><strong>Dot (.)<\/strong><\/span><\/p>\n<p>It matches anything except newline.<\/p>\n<ul>\n<li><span style=\"color: #ff0000\">.at<\/span> is a regex and can match <span style=\"color: #ff0000\">cat<\/span>, <span style=\"color: #ff0000\">bat<\/span>, <span style=\"color: #ff0000\">1at<\/span>, <span style=\"color: #ff0000\">#at<\/span>, <span style=\"color: #ff0000\">(at<\/span>, <span style=\"color: #ff0000\">.at<\/span>\u00a0etc strings.<\/li>\n<li>To change this behaviour of dot(.), escape it with a backslash, now\u00a0<span style=\"color: #ff0000\">\\.at<\/span> will just match\u00a0<span style=\"color: #ff0000\">.at<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000\"><b>{n}, {n, m}, {n, }<\/b><\/span><\/p>\n<p>To match same consecutive symbols over and over again, we can use curly-braces and to define length of character(s). They are also called quantifiers.<\/p>\n<ul>\n<li>string: \u00a0c<span style=\"color: #ff0000\">aaaaaaaaaa<\/span>t<\/li>\n<li>regex: \u00a0c<span style=\"color: #ff0000\">a{10}<\/span>t<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>Above regex will match <span style=\"color: #ff0000\">c<\/span>, 10 consecutive <span style=\"color: #ff0000\">a<span style=\"color: #808080\">&#8216;s<\/span><\/span> and a <span style=\"color: #ff0000\">t<\/span>.<\/p>\n<p>{n} = matches exactly \u2018n\u2019 times.<\/p>\n<p>{n, } = matches at least \u2018n\u2019 times but can match farther times, latter is known as greediness.<\/p>\n<p>{n, m} = matches at least \u2018n\u2019 times, but no more than \u2018m\u2019 times, \u2018m\u2019 is just the upper bound here.<\/p>\n<p>&nbsp;<\/p>\n<p>There are certain shortcut for defining quantifiers.<\/p>\n<p>&nbsp;<\/p>\n<p>* = {0, }<\/p>\n<p><span style=\"color: #ff0000\">*<\/span> matches 0 or more number of time, it also matches empty strings if there are zero matches.<\/p>\n<p>+ = {1, }<\/p>\n<p><span style=\"color: #ff0000\">+<\/span> matches 1 or more number of time, it does not matches empty strings.<\/p>\n<p>? = {0, 1}<\/p>\n<p><span style=\"color: #ff0000\">?<\/span> matches either 0 or 1 number of time, It also matches empty strings if there are zero match.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000\"><b>Question<\/b><\/span>: Match the highlighted text using quantifiers?<\/p>\n<p><span style=\"color: #ff0000\"><b>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <\/b>\u00a0 \u00a0 &lt;title&gt;<\/span>aaaabbbbbccccc<span style=\"color: #ff0000\">&lt;<\/span><span style=\"color: #ff0000\">\/title&gt;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000\"><b>Solution<\/b>:<\/span> <span style=\"color: #333333\"><span style=\"color: #808080\">A poor regex would be this<\/span> <span style=\"color: #ff0000\">&lt;.+&gt;<\/span> <span style=\"color: #808080\">because it won\u2019t give you the correct answer. Why?<\/span><\/span><\/p>\n<p><span style=\"color: #808080\">Let\u2019s analyse it.<\/span><\/p>\n<p><span style=\"color: #000000\"><b>S<\/b><b>tep 1<\/b>:<\/span><\/p>\n<p>String: <span style=\"color: #ff0000\">&lt;<\/span>title&gt;aaaabbbbbccccc&lt;\/title&gt;<\/p>\n<p>Regex: <span style=\"color: #ff0000\">&lt;<\/span>.+&gt;<\/p>\n<p>The regex starts with <span style=\"color: #ff0000\">&lt;<\/span> therefore, it will just match the angle bracket.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000\"><b>Step 2<\/b>:<\/span><\/p>\n<p>String: <span style=\"color: #ff0000\">&lt;title&gt;aaaabbbbbccccc&lt;\/title&gt;<\/span><\/p>\n<p>Regex: <span style=\"color: #808080\">&lt;<\/span><span style=\"color: #ff0000\">.+<\/span>&gt;<\/p>\n<p>The dot (<span style=\"color: #ff0000\">.<\/span>) will match only one character and using it with <span style=\"color: #ff0000\">+<\/span> will make it to match at least one character or more, as quantifiers are greedy, therefore it will match the whole\u00a0string.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000\"><b>Step 3<\/b>:<\/span><\/p>\n<p>String: <span style=\"color: #ff0000\">&lt;title&gt;aaaabbbbbccccc&lt;\/title<span style=\"color: #808080\">&gt;<\/span><\/span><\/p>\n<p>Regex: <span style=\"color: #808080\">&lt;.+<\/span><span style=\"color: #ff0000\">&gt;<\/span><\/p>\n<p>Now the regex engine will try to find the closing angle bracket, for this it will do backtracking from the end until it reaches the first angle bracket.<\/p>\n<p>Result: <span style=\"color: #ff0000\">&lt;title&gt;aaaabbbbbccccc&lt;\/title&gt;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Technically regex did what it suppose to do. But this isn\u2019t what we wanted.<\/p>\n<p>So the main culprit here is the greediness. To stop greediness use <span style=\"color: #ff0000\">?<\/span> in regex.<\/p>\n<p>&nbsp;<\/p>\n<p>Regex: <span style=\"color: #ff0000\">&lt;.+?&gt;<\/span><\/p>\n<p>String: <span style=\"color: #ff0000\">&lt;title&gt;<\/span>aaaabbbbbccccc<span style=\"color: #ff0000\">&lt;\/title&gt;<\/span><\/p>\n<p>now it match as little as possible.<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000\"><b>Brackets <span style=\"color: #ff0000\">[ ]<\/span><\/b><\/span><\/p>\n<p><span style=\"color: #000000\"><span style=\"color: #ff0000\">[ ]<\/span> <\/span>are used to set alternation between characters or ranges or both.<\/p>\n<ul>\n<li>\u00a0<span style=\"color: #ff0000\">[abc] <\/span>which means match either <span style=\"color: #ff0000\">a<\/span> or <span style=\"color: #ff0000\">b<\/span> or <span style=\"color: #ff0000\">c<\/span>, not all at the same time.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><b style=\"color: #000000\">Question<\/b><span style=\"color: #000000\">: <span style=\"color: #808080\">Match using <\/span><\/span><span style=\"color: #ff0000\">[ ]<\/span><\/p>\n<dl>\n<dd>\n<table style=\"height: 256px\" width=\"183\" cellspacing=\"0\" cellpadding=\"4\">\n<colgroup>\n<col width=\"82\" \/>\n<col width=\"82\" \/><\/colgroup>\n<tbody>\n<tr valign=\"top\">\n<td width=\"82\"><span style=\"color: #808080\">Match<\/span><\/td>\n<td width=\"82\"><span style=\"color: #808080\">can<\/span><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td width=\"82\"><span style=\"color: #808080\">Match<\/span><\/td>\n<td width=\"82\"><span style=\"color: #808080\">man<\/span><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td width=\"82\"><span style=\"color: #808080\">Match<\/span><\/td>\n<td width=\"82\"><span style=\"color: #808080\">fan<\/span><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td width=\"82\"><span style=\"color: #808080\">Match<\/span><\/td>\n<td width=\"82\"><span style=\"color: #808080\">jan<\/span><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td width=\"82\"><span style=\"color: #808080\">Skip<\/span><\/td>\n<td width=\"82\"><span style=\"color: #808080\">ran<\/span><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td width=\"82\"><span style=\"color: #808080\">Skip<\/span><\/td>\n<td width=\"82\"><span style=\"color: #808080\">tan<\/span><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td width=\"82\"><span style=\"color: #808080\">Skip<\/span><\/td>\n<td width=\"82\"><span style=\"color: #808080\">pan<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/dd>\n<\/dl>\n<p><span style=\"color: #000000\"><b>Solution<\/b>: <\/span><span style=\"color: #ff0000\">[cmfj]<\/span>an<\/p>\n<p>&nbsp;<\/p>\n<p>To avoid writing all characters inside <span style=\"color: #ff0000\">[ ]<\/span> you can write ranges like <span style=\"color: #ff0000\">[a-z]<\/span> will match all small English characters.<\/p>\n<p>You can also combine different ranges like this <span style=\"color: #ff0000\">[a-zA-Z0-9]<\/span>, this will match all capital, small alphabets, and numbers. And using a quantifier with <span style=\"color: #ff0000\">[ ]<\/span> can match multiple characters.<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000\">Match<\/span><\/strong>: aabbccddeeaabbzztt<\/p>\n<p><span style=\"color: #000000\"><strong>Regex<\/strong><\/span>: <span style=\"color: #ff0000\">[a-z]+<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Instead of writing long ranges of characters, numbers inside <span style=\"color: #ff0000\">[ ]<\/span> you can use character classes.<\/p>\n<p>&nbsp;<\/p>\n<p>[<span style=\"color: #ff0000\">\\w<\/span>] = [a-zA-Z0-9_]<\/p>\n<p>It contain plain old English characters, numbers and an underscore, it will not match <strong>\u2126<\/strong> or <strong>\u03d5 <\/strong>kind of\u00a0symbols.<\/p>\n<p>&nbsp;<\/p>\n<p>[<span style=\"color: #ff0000\">\\d<\/span>] = [0-9]<\/p>\n<p>It contain numbers from 0 to 9.<\/p>\n<p>&nbsp;<\/p>\n<p>[<span style=\"color: #ff0000\">\\s<\/span>]\u00a0\u2248 [\\n\\t\\r ]<\/p>\n<p>This class contain a tab, newline, vertical tab, form feed, carriage return and space.<\/p>\n<p>&nbsp;<\/p>\n<p><b style=\"color: #000000\">Question<\/b><span style=\"color: #000000\">: <\/span>Match hex-color<\/p>\n<dl>\n<dd>\n<table style=\"height: 256px\" width=\"183\" cellspacing=\"0\" cellpadding=\"4\">\n<colgroup>\n<col width=\"82\" \/>\n<col width=\"82\" \/> <\/colgroup>\n<tbody>\n<tr valign=\"top\">\n<td width=\"82\"><span style=\"color: #808080\">Match<\/span><\/td>\n<td width=\"82\"><span style=\"color: #808080\">#abc<\/span><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td width=\"82\"><span style=\"color: #808080\">Match<\/span><\/td>\n<td width=\"82\"><span style=\"color: #808080\">#f55<\/span><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td width=\"82\"><span style=\"color: #808080\">Match<\/span><\/td>\n<td width=\"82\"><span style=\"color: #808080\">#XTQ67A<\/span><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td width=\"82\"><span style=\"color: #808080\">Match<\/span><\/td>\n<td width=\"82\"><span style=\"color: #808080\">#C0FFEE<\/span><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td width=\"82\"><span style=\"color: #808080\">Skip<\/span><\/td>\n<td width=\"82\"><span style=\"color: #808080\">#!AB<\/span><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td width=\"82\"><span style=\"color: #808080\">Skip<\/span><\/td>\n<td width=\"82\"><span style=\"color: #808080\">#!f004<\/span><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td width=\"82\"><span style=\"color: #808080\">Skip<\/span><\/td>\n<td width=\"82\"><span style=\"color: #808080\">#f5Y<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/dd>\n<\/dl>\n<p><span style=\"color: #000000\"><b>Solution<\/b>:<\/span> <span style=\"color: #808080\">Hex colors are about of 3 and 6 characters long which contain alphabets from &#8216;a\u2019 to \u2018f\u2019 and \u2018A\u2019 to \u2018F\u2019 and numbers, which means #f00 is valid hex color code and #K00, #f002 are invalid. Therefore, we need to filter out those hex colors which have wrong alphabets and are of the wrong length.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #333333\"><span style=\"color: #808080\">Many\u00a0people will write this regex<\/span> <span style=\"color: #ff0000\">#[a-fA-F\\d]{3,6}<\/span><span style=\"color: #808080\">, well this is wrong, because it does not filter out hex colors of invalid length.\u00a0<\/span><\/span><span style=\"color: #808080\">The correct solution is<\/span> <span style=\"color: #ff0000\">#([a-fA-F\\d]{3}){1,2}<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000\"><b>Analysis<\/b>:<span style=\"color: #808080\"> Here we have used the brackets to group the regex and added a quantifier of 3 which matches any letter a-f and A-F and digits 3 times and this pattern needs to be repeated once (3 length) or twice (6 length), therefore another quantifier is added {1,2} outside the brakets..<\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #808080\">More on brackets<b> <\/b>and other topics of regex in the next part.<\/span><\/p>\n<p><span style=\"color: #808080\">Thanks for your time.<\/span><\/p>\n<p><span style=\"color: #808080\">Stay tuned.<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Doesn&#8217;t matter even if you are a ninja programmer or a novice, at a <a class=\"text-primary\" title=\"read more\" href=\"https:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":20,"featured_media":3161,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Demystifying The Regular Expressions \u2013 I - Cloudkul<\/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:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Demystifying The Regular Expressions \u2013 I - Cloudkul\" \/>\n<meta property=\"og:description\" content=\"&nbsp; Doesn&#8217;t matter even if you are a ninja programmer or a novice, at a [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudkul\" \/>\n<meta property=\"article:published_time\" content=\"2017-07-14T09:46:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-07-18T05:02:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2017\/07\/download-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"848\" \/>\n\t<meta property=\"og:image:height\" content=\"422\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"gaurav kaushik\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/\",\"url\":\"https:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/\",\"name\":\"Demystifying The Regular Expressions \u2013 I - Cloudkul\",\"isPartOf\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\"},\"datePublished\":\"2017-07-14T09:46:22+00:00\",\"dateModified\":\"2017-07-18T05:02:11+00:00\",\"author\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/e371b8794739bf7b5a2e863cf3f0a646\"},\"breadcrumb\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Demystifying The Regular Expressions \u2013 I\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\",\"url\":\"https:\/\/cloudkul.com\/blog\/\",\"name\":\"Cloudkul\",\"description\":\"Host your eCommerce Store on AWS with Optimized Performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudkul.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/e371b8794739bf7b5a2e863cf3f0a646\",\"name\":\"gaurav kaushik\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5c4395467d2a914cba03db5c913f6ad9?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5c4395467d2a914cba03db5c913f6ad9?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"caption\":\"gaurav kaushik\"},\"url\":\"https:\/\/cloudkul.com\/blog\/author\/gaurav-kaushik651\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Demystifying The Regular Expressions \u2013 I - Cloudkul","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:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/","og_locale":"en_US","og_type":"article","og_title":"Demystifying The Regular Expressions \u2013 I - Cloudkul","og_description":"&nbsp; Doesn&#8217;t matter even if you are a ninja programmer or a novice, at a [...]","og_url":"https:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/","og_site_name":"Cloudkul","article_published_time":"2017-07-14T09:46:22+00:00","article_modified_time":"2017-07-18T05:02:11+00:00","og_image":[{"width":848,"height":422,"url":"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2017\/07\/download-2.png","type":"image\/png"}],"author":"gaurav kaushik","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/","url":"https:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/","name":"Demystifying The Regular Expressions \u2013 I - Cloudkul","isPartOf":{"@id":"https:\/\/cloudkul.com\/blog\/#website"},"datePublished":"2017-07-14T09:46:22+00:00","dateModified":"2017-07-18T05:02:11+00:00","author":{"@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/e371b8794739bf7b5a2e863cf3f0a646"},"breadcrumb":{"@id":"https:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cloudkul.com\/blog\/demystifying-regular-expression\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Demystifying The Regular Expressions \u2013 I"}]},{"@type":"WebSite","@id":"https:\/\/cloudkul.com\/blog\/#website","url":"https:\/\/cloudkul.com\/blog\/","name":"Cloudkul","description":"Host your eCommerce Store on AWS with Optimized Performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudkul.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/e371b8794739bf7b5a2e863cf3f0a646","name":"gaurav kaushik","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5c4395467d2a914cba03db5c913f6ad9?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c4395467d2a914cba03db5c913f6ad9?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","caption":"gaurav kaushik"},"url":"https:\/\/cloudkul.com\/blog\/author\/gaurav-kaushik651\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/3040"}],"collection":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/comments?post=3040"}],"version-history":[{"count":117,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/3040\/revisions"}],"predecessor-version":[{"id":3177,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/3040\/revisions\/3177"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media\/3161"}],"wp:attachment":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media?parent=3040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/categories?post=3040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/tags?post=3040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}