{"id":827,"date":"2021-04-22T06:13:27","date_gmt":"2021-04-22T06:13:27","guid":{"rendered":"https:\/\/bcisnotes.com\/fourthsemester\/?p=827"},"modified":"2021-04-22T06:13:27","modified_gmt":"2021-04-22T06:13:27","slug":"regular-expression-server-side-scripting-bcis-notes","status":"publish","type":"post","link":"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/","title":{"rendered":"Regular Expression || Server Side Scripting || BCIS Notes"},"content":{"rendered":"<div class=\"page\" title=\"Page 49\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<h1 style=\"text-align: center;\">Regular Expression<\/h1>\n<div class=\"page\" title=\"Page 49\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Regular Expression, commonly known as &#8220;regex&#8221; or &#8220;RegExp&#8221;, are specially formatted text strings used to find patterns in text. Regular expressions are one of the most powerful tools available today for effective and efficient text processing and manipulations. For example, it can be used to verify whether the format of data i.e. name, email, phone number, etc. entered by the user was correct or not, find or replace matching string within text content, and so on.<\/p>\n<p>PHP (version 5.3 and above) supports Perl-style regular expressions via\u00a0its preg_ family of functions. Why Perl style regular expressions? Because Perl (Practical Extraction and Report Language) was the first mainstream programming language that provided integrated support for regular expressions and it is well known for its strong support of regular expressions and its extraordinary text processing and manipulation capabilities.<\/p>\n<p>Let&#8217;s begin with a brief overview of the commonly used PHP&#8217;s built-in pattern-matching functions before delving deep into the world of regular expressions.<\/p>\n<\/div>\n<\/div>\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<table width=\"920\">\n<tbody>\n<tr>\n<th>Function<\/th>\n<th>What it Does<\/th>\n<\/tr>\n<tr>\n<td>preg_match()<\/td>\n<td>Perform a regular expression match.<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<pre>preg_match_all()<\/pre>\n<\/div>\n<\/div>\n<\/td>\n<td>Perform a global regular expression match.<\/td>\n<\/tr>\n<tr>\n<td>preg_replace()<\/td>\n<td>Perform a regular expression search and replace.<\/td>\n<\/tr>\n<tr>\n<td>preg_grep()<\/td>\n<td>Returns the elements of the input array that matched the pattern.<\/td>\n<\/tr>\n<tr>\n<td>preg_split()<\/td>\n<td>Splits up a string into substrings using a regular expression.<\/td>\n<\/tr>\n<tr>\n<td>preg_quote()<\/td>\n<td>Quote regular expression characters found within a string.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>Note: The PHP preg_match() function stops searching after it finds the first match, whereas the preg_match_all() function continues searching until the end of the string and finds all possible matches instead of stopping at the first match.<\/p>\n<\/div>\n<\/div>\n<div class=\"page\" title=\"Page 50\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<h2>Regular Expression Syntax<\/h2>\n<p>Regular expression syntax includes the use of special characters (do not confuse with the HTML special characters). The characters that are given special meaning within a regular expression, are:.*?+[](){}^$|\\. You will need to backslash these characters whenever you want to use them literally. For example, if you want to match &#8220;.&#8221;, you&#8217;d have to write \\.. All other characters automatically assume their literal meanings.<\/p>\n<p>The following sections describe the various options available for formulating patterns:<\/p>\n<h2>Character Classes<\/h2>\n<p>Square brackets surrounding a pattern of characters are called a character class e.g. [abc]. A character class always matches a single character out of a list of specified characters that means the expression [abc] matches only a, b or c character.<\/p>\n<p>Negated character classes can also be defined that match any character except those contained within the brackets. A negated character class is defined by placing a caret (^) symbol immediately after the opening bracket, like this [^abc].<\/p>\n<p>You can also define a range of characters by using the hyphen (-) character inside a character class, like [0-9]. Let&#8217;s look at some examples of character classes:<\/p>\n<\/div>\n<\/div>\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<table width=\"919\">\n<tbody>\n<tr>\n<th>RegExp<\/th>\n<th>What it Does<\/th>\n<\/tr>\n<tr>\n<td>[abc]<\/td>\n<td>Matches any one of the characters a, b, or c.<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<pre>[^abc]<\/pre>\n<\/div>\n<\/div>\n<\/td>\n<td>Matches any one character other than a, b, or c.<\/td>\n<\/tr>\n<tr>\n<td>[a-z]<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Matches any one character from lowercase a to lowercase z.<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>[A-Z]<\/p>\n<\/div>\n<\/div>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Matches any one character from uppercase a to uppercase z.<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>[a-Z]<\/td>\n<td>Matches any one character from lowercase a to uppercase Z.<\/td>\n<\/tr>\n<tr>\n<td>[0-9]<\/td>\n<td>Matches a single digit between 0 and 9.<\/p>\n<div class=\"layoutArea\">\n<div class=\"column\"><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>[a-Z]<\/td>\n<td>Matches any one character from lowercase a to uppercase Z.<\/td>\n<\/tr>\n<tr>\n<td>[a-z0-9]<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Matches a single character between a and z or between 0 and 9.<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"page\" title=\"Page 51\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>The following example will show you how to find whether a pattern exists in a string or not using the regular expression and PHP preg_match() function:<\/p>\n<\/div>\n<\/div>\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Example:<\/p>\n<\/div>\n<\/div>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8949 size-full\" title=\"preg_match()\" src=\"https:\/\/www.onlinenotesnepal.com\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-12-at-1.40.31-PM.png\" alt=\"preg_match()\" width=\"697\" height=\"155\" \/><\/p>\n<\/div>\n<\/div>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<pre><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Similarly, you can use the preg_match_all() function to find all matches within a string:<\/p>\n<p>Example:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8951\" src=\"https:\/\/www.onlinenotesnepal.com\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-12-at-1.42.29-PM.png\" alt=\"\" width=\"708\" height=\"130\" \/><\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<p><strong>Predefined Character Classes<\/strong><\/p>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Some character classes such as digits, letters, and whitespaces are used so frequently that there are shortcut names for them. The following table lists those predefined character classes:<\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<th>Shortcut<\/th>\n<th>What it does<\/th>\n<\/tr>\n<tr>\n<td>.<\/td>\n<td>Matches any single character except newline \\n.<\/td>\n<\/tr>\n<tr>\n<td>\/d<\/td>\n<td>matches any digit character. Same as [0-9]<\/td>\n<\/tr>\n<tr>\n<td>\/D<\/td>\n<td>Matches any non-digit character. Same as [^0-9]<\/td>\n<\/tr>\n<tr>\n<td>\/s<\/td>\n<td>Matches any whitespace character (space, tab, newline or carriage return character). Same as [\/t\/n]<\/td>\n<\/tr>\n<tr>\n<td>\/s<\/td>\n<td>Matches any non-whitespace character. Same as [^\/t\/n\/r]<\/td>\n<\/tr>\n<tr>\n<td>\/w<\/td>\n<td>Matches any word character (definned as a to z, A to Z,0 to 9, and the underscore). Same as [a-zA-Z_9]<\/td>\n<\/tr>\n<tr>\n<td>\/W<\/td>\n<td>\n<div class=\"page\" title=\"Page 52\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Matches any non-word character. Same a [^a-zA-Z_0-9]<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Repetition Quantifiers<\/h2>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"page\" title=\"Page 52\">\n<div class=\"section\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>In the previous section, we&#8217;ve learned how to match a single character in a variety of fashions. But what if you want to match on more than one character? For example, let&#8217;s say you want to find out words containing one or more instances of the letter p, or words containing at least two p&#8217;s, and so on. This is where quantifiers come into play. With quantifiers, you can specify how many times a character in a regular expression should match.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"page\" title=\"Page 53\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>The following table lists the various ways to quantify a particular pattern:<\/p>\n<\/div>\n<\/div>\n<table width=\"924\">\n<colgroup>\n<col \/>\n<col \/><\/colgroup>\n<tbody>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>RegExp<\/strong><\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><strong>What it Does<\/strong><\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>p+<\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Matches one or more occurrences of the letter p.<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>p*<\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Matches zero or more occurrences of the letter p.<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>p?<\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Matches zero or one occurrence of the letter p.<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>p{2}<\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Matches exactly two occurrences of the letter p.<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>p{2,3}<\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Matches at least two occurrences of the letter p, but not more than three occurrences of the letter p.<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>p{2,}<\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Matches two or more occurrences of the letter p.<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>p{,3}<\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Matches at most three occurrences of the letter p<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>The regular expression in the following example will split the string at the comma, sequence of commas, whitespace, or a combination thereof using the\u00a0PHP preg_split() function:<\/p>\n<\/div>\n<\/div>\n<p>Example:<\/p>\n<\/div>\n<div title=\"Page 53\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8965 size-full\" title=\"Repetition Quantifiers\" src=\"https:\/\/www.onlinenotesnepal.com\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-12-at-2.12.00-PM.png\" alt=\"Repetition Quantifiers\" width=\"696\" height=\"144\" \/><\/div>\n<div class=\"page\" title=\"Page 54\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<h2>Position Anchors<\/h2>\n<p>There are certain situations where you want to match at the beginning or end of a line, word, or string. To do this you can use anchors. Two common anchors are caret (^) which represents the start of the string, and the dollar ($) sign which represents the end of the string.<\/p>\n<p>The regular expression in the following example will display only those names from the names array which start with the letter &#8220;J&#8221; using the\u00a0PHP preg_grep() function:<\/p>\n<\/div>\n<\/div>\n<table width=\"921\">\n<tbody>\n<tr>\n<th>RegExp<\/th>\n<th>What it does<\/th>\n<\/tr>\n<tr>\n<td>^p<\/td>\n<td>Matches the letter p at the beginning of a line.<\/td>\n<\/tr>\n<tr>\n<td>p$<\/td>\n<td>Matches the letter p at the end of a line.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"page\" title=\"Page 54\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>The regular expression in the following example will display only those names from the names array which start with the letter &#8220;J&#8221; using the\u00a0PHP preg_grep() function:<\/p>\n<\/div>\n<\/div>\n<\/div>\n<h2><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8969 size-full\" title=\"Position Anchors\" src=\"https:\/\/www.onlinenotesnepal.com\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-12-at-2.15.49-PM.png\" alt=\"Position Anchors\" width=\"700\" height=\"169\" \/><br \/>\nPattern Modifiers<\/h2>\n<p>A pattern modifier allows you to control the way a pattern match is handled. Pattern modifiers are placed directly after the regular expression, for example, if you want to search for a pattern in a case-insensitive manner, you can use<br \/>\nthe I modifier, like this: \/pattern\/i. The following table lists some of the most commonly used pattern modifiers.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"page\" title=\"Page 55\">\n<table>\n<colgroup>\n<col \/>\n<col \/><\/colgroup>\n<tbody>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Modifier<\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>What it Does<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>I<\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Makes the match case-insensitive manner.<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>M<\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Changes the behavior of ^ and $ to match against a newline boundary (i.e. start or end of each line within a multiline string), instead of a string boundary.<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>G<\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Perform a global match i.e. finds all occurrences.<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>O<\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Evaluates the expression only once.<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>S<\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Changes the behavior of . (dot) to match all characters, including newlines.<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>X<\/p>\n<\/div>\n<\/div>\n<\/td>\n<td>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Allows you to use whitespace and comments within a regular expression for clarity.<\/p>\n<\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>The following example will show you how to perform a global case-insensitive search using the i modifier and the PHP preg_match_all() function.<\/p>\n<\/div>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8972\" src=\"https:\/\/www.onlinenotesnepal.com\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-12-at-2.17.16-PM.png\" alt=\"Pattern Modifier\" width=\"694\" height=\"148\" \/><\/p>\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Similarly, the following example shows how to match at the beginning of every line in a multi-line string using ^ anchor and m modifier with\u00a0PHP preg_match_all() function.<\/p>\n<\/div>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8973\" src=\"https:\/\/www.onlinenotesnepal.com\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-12-at-2.18.13-PM.png\" alt=\"Pattern Modifier\" width=\"693\" height=\"123\" \/><\/p>\n<\/div>\n<div class=\"page\" title=\"Page 56\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<h2>Word Boundaries<\/h2>\n<p>A word boundary character ( \\b) helps you search for the words that begin and\/or end with a pattern. For example, the regexp \/\\bcar\/ matches the words beginning with the pattern car, and would match cart, carrot, or cartoon, but would not match oscar.<\/p>\n<p>Similarly, the regexp \/car\\b\/ matches the words ending with the pattern car, and would match scar, oscar, or supercar, but would not match cart. Likewise,<br \/>\nthe \/\\bcar\\b\/ matches the words beginning and ending with the pattern car and would match only the word car.<\/p>\n<p>The following example will highlight the words beginning with the car in bold:<\/p>\n<\/div>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8976\" src=\"https:\/\/www.onlinenotesnepal.com\/wp-content\/uploads\/2021\/04\/Screen-Shot-2021-04-12-at-2.19.33-PM.png\" alt=\"Word Boundaries\" width=\"741\" height=\"134\" \/><\/p>\n<\/div>\n<div title=\"Page 56\">\n<p>If you liked our content Regular Expression, then you may also like\u00a0<a href=\"https:\/\/bcisnotes.com\/fourthsemester\/php-exercises-server-side-scripting-bcis-notes\/\">PHP Exercises<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Regular Expression Regular Expression, commonly known as &#8220;regex&#8221; or &#8220;RegExp&#8221;, are specially formatted text strings used to find patterns in text. Regular expressions are one <a class=\"mh-excerpt-more\" href=\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/\" title=\"Regular Expression || Server Side Scripting || BCIS Notes\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":3,"featured_media":828,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[255,267,228],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Regular Expression || Server Side Scripting || BCIS Notes<\/title>\n<meta name=\"description\" content=\"Regular Expression, commonly known as &quot;regex&quot; or &quot;RegExp&quot;, are specially formatted text strings used to find patterns in text.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Regular Expression || Server Side Scripting || BCIS Notes\" \/>\n<meta property=\"og:description\" content=\"Regular Expression, commonly known as &quot;regex&quot; or &quot;RegExp&quot;, are specially formatted text strings used to find patterns in text.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/\" \/>\n<meta property=\"og:site_name\" content=\"BCIS Fourth Semester\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-22T06:13:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/bcisnotes.com\/fourthsemester\/wp-content\/uploads\/2021\/04\/bcis-37.png\" \/>\n\t<meta property=\"og:image:width\" content=\"340\" \/>\n\t<meta property=\"og:image:height\" content=\"230\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Her Highness\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Her Highness\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/\"},\"author\":{\"name\":\"Her Highness\",\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/#\/schema\/person\/fcc10e27b06f3f95367e914911b47eb3\"},\"headline\":\"Regular Expression || Server Side Scripting || BCIS Notes\",\"datePublished\":\"2021-04-22T06:13:27+00:00\",\"dateModified\":\"2021-04-22T06:13:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/\"},\"wordCount\":1365,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/#organization\"},\"image\":{\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/bcisnotes.com\/fourthsemester\/wp-content\/uploads\/2021\/04\/bcis-37.png\",\"keywords\":[\"PHP\",\"Regular Expression\",\"Server Side Scripting\"],\"articleSection\":[\"IT\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/\",\"url\":\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/\",\"name\":\"Regular Expression || Server Side Scripting || BCIS Notes\",\"isPartOf\":{\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/bcisnotes.com\/fourthsemester\/wp-content\/uploads\/2021\/04\/bcis-37.png\",\"datePublished\":\"2021-04-22T06:13:27+00:00\",\"dateModified\":\"2021-04-22T06:13:27+00:00\",\"description\":\"Regular Expression, commonly known as \\\"regex\\\" or \\\"RegExp\\\", are specially formatted text strings used to find patterns in text.\",\"breadcrumb\":{\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#primaryimage\",\"url\":\"https:\/\/bcisnotes.com\/fourthsemester\/wp-content\/uploads\/2021\/04\/bcis-37.png\",\"contentUrl\":\"https:\/\/bcisnotes.com\/fourthsemester\/wp-content\/uploads\/2021\/04\/bcis-37.png\",\"width\":340,\"height\":230,\"caption\":\"Regular Expression || Server Side Scripting || BCIS Notes\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/bcisnotes.com\/fourthsemester\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Regular Expression || Server Side Scripting || BCIS Notes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/#website\",\"url\":\"https:\/\/bcisnotes.com\/fourthsemester\/\",\"name\":\"BCIS Fourth Semester\",\"description\":\"Notes of Information and Technology\",\"publisher\":{\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/bcisnotes.com\/fourthsemester\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/#organization\",\"name\":\"BCIS Fourth Semester\",\"url\":\"https:\/\/bcisnotes.com\/fourthsemester\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/bcisnotes.com\/fourthsemester\/wp-content\/uploads\/2021\/02\/cropped-4-1.jpg\",\"contentUrl\":\"https:\/\/bcisnotes.com\/fourthsemester\/wp-content\/uploads\/2021\/02\/cropped-4-1.jpg\",\"width\":300,\"height\":100,\"caption\":\"BCIS Fourth Semester\"},\"image\":{\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/#\/schema\/person\/fcc10e27b06f3f95367e914911b47eb3\",\"name\":\"Her Highness\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/bcisnotes.com\/fourthsemester\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9f5c6e84ebb073447dba2985b41b0fdc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9f5c6e84ebb073447dba2985b41b0fdc?s=96&d=mm&r=g\",\"caption\":\"Her Highness\"},\"sameAs\":[\"http:\/\/bcisnotes.com\/fourthsemester\"],\"url\":\"https:\/\/bcisnotes.com\/fourthsemester\/author\/jaya\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Regular Expression || Server Side Scripting || BCIS Notes","description":"Regular Expression, commonly known as \"regex\" or \"RegExp\", are specially formatted text strings used to find patterns in text.","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:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/","og_locale":"en_US","og_type":"article","og_title":"Regular Expression || Server Side Scripting || BCIS Notes","og_description":"Regular Expression, commonly known as \"regex\" or \"RegExp\", are specially formatted text strings used to find patterns in text.","og_url":"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/","og_site_name":"BCIS Fourth Semester","article_published_time":"2021-04-22T06:13:27+00:00","og_image":[{"width":340,"height":230,"url":"https:\/\/bcisnotes.com\/fourthsemester\/wp-content\/uploads\/2021\/04\/bcis-37.png","type":"image\/png"}],"author":"Her Highness","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Her Highness","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#article","isPartOf":{"@id":"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/"},"author":{"name":"Her Highness","@id":"https:\/\/bcisnotes.com\/fourthsemester\/#\/schema\/person\/fcc10e27b06f3f95367e914911b47eb3"},"headline":"Regular Expression || Server Side Scripting || BCIS Notes","datePublished":"2021-04-22T06:13:27+00:00","dateModified":"2021-04-22T06:13:27+00:00","mainEntityOfPage":{"@id":"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/"},"wordCount":1365,"commentCount":0,"publisher":{"@id":"https:\/\/bcisnotes.com\/fourthsemester\/#organization"},"image":{"@id":"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#primaryimage"},"thumbnailUrl":"https:\/\/bcisnotes.com\/fourthsemester\/wp-content\/uploads\/2021\/04\/bcis-37.png","keywords":["PHP","Regular Expression","Server Side Scripting"],"articleSection":["IT"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/","url":"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/","name":"Regular Expression || Server Side Scripting || BCIS Notes","isPartOf":{"@id":"https:\/\/bcisnotes.com\/fourthsemester\/#website"},"primaryImageOfPage":{"@id":"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#primaryimage"},"image":{"@id":"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#primaryimage"},"thumbnailUrl":"https:\/\/bcisnotes.com\/fourthsemester\/wp-content\/uploads\/2021\/04\/bcis-37.png","datePublished":"2021-04-22T06:13:27+00:00","dateModified":"2021-04-22T06:13:27+00:00","description":"Regular Expression, commonly known as \"regex\" or \"RegExp\", are specially formatted text strings used to find patterns in text.","breadcrumb":{"@id":"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#primaryimage","url":"https:\/\/bcisnotes.com\/fourthsemester\/wp-content\/uploads\/2021\/04\/bcis-37.png","contentUrl":"https:\/\/bcisnotes.com\/fourthsemester\/wp-content\/uploads\/2021\/04\/bcis-37.png","width":340,"height":230,"caption":"Regular Expression || Server Side Scripting || BCIS Notes"},{"@type":"BreadcrumbList","@id":"https:\/\/bcisnotes.com\/fourthsemester\/regular-expression-server-side-scripting-bcis-notes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/bcisnotes.com\/fourthsemester\/"},{"@type":"ListItem","position":2,"name":"Regular Expression || Server Side Scripting || BCIS Notes"}]},{"@type":"WebSite","@id":"https:\/\/bcisnotes.com\/fourthsemester\/#website","url":"https:\/\/bcisnotes.com\/fourthsemester\/","name":"BCIS Fourth Semester","description":"Notes of Information and Technology","publisher":{"@id":"https:\/\/bcisnotes.com\/fourthsemester\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/bcisnotes.com\/fourthsemester\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/bcisnotes.com\/fourthsemester\/#organization","name":"BCIS Fourth Semester","url":"https:\/\/bcisnotes.com\/fourthsemester\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bcisnotes.com\/fourthsemester\/#\/schema\/logo\/image\/","url":"https:\/\/bcisnotes.com\/fourthsemester\/wp-content\/uploads\/2021\/02\/cropped-4-1.jpg","contentUrl":"https:\/\/bcisnotes.com\/fourthsemester\/wp-content\/uploads\/2021\/02\/cropped-4-1.jpg","width":300,"height":100,"caption":"BCIS Fourth Semester"},"image":{"@id":"https:\/\/bcisnotes.com\/fourthsemester\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/bcisnotes.com\/fourthsemester\/#\/schema\/person\/fcc10e27b06f3f95367e914911b47eb3","name":"Her Highness","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bcisnotes.com\/fourthsemester\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9f5c6e84ebb073447dba2985b41b0fdc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9f5c6e84ebb073447dba2985b41b0fdc?s=96&d=mm&r=g","caption":"Her Highness"},"sameAs":["http:\/\/bcisnotes.com\/fourthsemester"],"url":"https:\/\/bcisnotes.com\/fourthsemester\/author\/jaya\/"}]}},"_links":{"self":[{"href":"https:\/\/bcisnotes.com\/fourthsemester\/wp-json\/wp\/v2\/posts\/827"}],"collection":[{"href":"https:\/\/bcisnotes.com\/fourthsemester\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bcisnotes.com\/fourthsemester\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bcisnotes.com\/fourthsemester\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/bcisnotes.com\/fourthsemester\/wp-json\/wp\/v2\/comments?post=827"}],"version-history":[{"count":1,"href":"https:\/\/bcisnotes.com\/fourthsemester\/wp-json\/wp\/v2\/posts\/827\/revisions"}],"predecessor-version":[{"id":829,"href":"https:\/\/bcisnotes.com\/fourthsemester\/wp-json\/wp\/v2\/posts\/827\/revisions\/829"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bcisnotes.com\/fourthsemester\/wp-json\/wp\/v2\/media\/828"}],"wp:attachment":[{"href":"https:\/\/bcisnotes.com\/fourthsemester\/wp-json\/wp\/v2\/media?parent=827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bcisnotes.com\/fourthsemester\/wp-json\/wp\/v2\/categories?post=827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bcisnotes.com\/fourthsemester\/wp-json\/wp\/v2\/tags?post=827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}