{"id":10683,"date":"2016-02-09T16:15:31","date_gmt":"2016-02-09T14:15:31","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=10683"},"modified":"2018-01-10T16:16:13","modified_gmt":"2018-01-10T14:16:13","slug":"javascript-regular-expressions-example","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/","title":{"rendered":"Javascript Regular Expressions Example"},"content":{"rendered":"<p>Regular expressions are patterns used to match character combinations in strings. They are used to perform pattern-matching and &#8220;search-and-replace&#8221; functions on text. In JavaScript, regular expressions are also objects.<\/p>\n<p>JavaScript&#8217;s regular expression flavor is part of the ECMA-262 standard for the language. This means your regular expressions should work exactly the same in all implementations of JavaScript. In the past there were many serious browser-specific issues. But modern browsers do a very good job of following the JavaScript standard for regular expressions. You only need to make sure your web pages have a doctype that requests the browser to use standards mode rather than quirks mode.<br \/>\n&nbsp;<br \/>\n[ulp id=&#8217;tCIwOngQUb3zSUuF&#8217;]<\/p>\n<div class=\"toc\">\n<h3>Table Of Contents<\/h3>\n<dl>\n<dt><a href=\"#introduction\">1. Document Setup &amp; Introduction<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#doc-setup\">1.1 Document Setup<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dd>\n<dl>\n<dt><a href=\"#syntax\">1.2 Syntax &amp; Application<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dd>\n<dl>\n<dt><a href=\"#application\">1.3 Creating a regular expression<\/a><\/dt>\n<\/dl>\n<\/dd>\n<\/dl>\n<dl>\n<dt><a href=\"#types\">2. Types of Regular Expressions<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#modifiers\">2.1 Modifiers<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dd>\n<dl>\n<dt><a href=\"#brackets\">2.2 Brackets<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dd>\n<dl>\n<dt><a href=\"#metacharacters\">2.3 Metacharacters<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dd>\n<dl>\n<dt><a href=\"#quantifiers\">2.4 Quantifiers<\/a><\/dt>\n<\/dl>\n<\/dd>\n<\/dl>\n<dl>\n<dt><a href=\"#regexp\">3. RegExp Object<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#properties\">2.1 RegExp Object Properties<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dd>\n<dl>\n<dt><a href=\"#methods\">2.2 RegExp Object Methods<\/a><\/dt>\n<\/dl>\n<\/dd>\n<\/dl>\n<dl>\n<dt><a href=\"#conclusion\">4. Conclusion<\/a><\/dt>\n<\/dl>\n<dl>\n<dt><a href=\"#download\">5. Download the source code<\/a><\/dt>\n<\/dl>\n<\/div>\n<h2><a name=\"introduction\"><\/a>1. Document Setup &amp; Introduction<\/h2>\n<p>The following section helps you prepare the file where we&#8217;re going to code and introduce you to the very basic syntax and application of regular expressions. We&#8217;ll have a more detailed look at each of the ways we can use these expressions later in this article.<\/p>\n<h3><a name=\"doc-setup\"><\/a>1.1 Document Setup<\/h3>\n<p>First, create a new HTML document with the basic syntax inside, including an empty (for now) <code>script<\/code> section:<\/p>\n<p><span style=\"text-decoration: underline\"><em>js-regexp.html<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;title&gt;Javascript Regular Expressions Example&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;!-- HTML SECTION  --&gt;\r\n\r\n&lt;!-- JAVASCRIPT SECTION  --&gt;\r\n&lt;script type=\"text\/javascript\"&gt;\r\n\r\n&lt;\/script&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>In the HTML section, let&#8217;s also add few lines we&#8217;ll need for more interactive results:<\/p>\n<pre class=\"brush:xml\">&lt;!-- HTML SECTION  --&gt;\r\n&lt;p&gt;Click the button to perform something with regular expressions.&lt;\/p&gt;\r\n&lt;button onclick=\"resultFunction()\"&gt;See Result&lt;\/button&gt;\r\n&lt;p id=\"result\"&gt;&lt;\/p&gt;\r\n<\/pre>\n<h3><a name=\"syntax\"><\/a>1.2 Syntax &amp; Application<\/h3>\n<p>The syntax of a regular expression is as follows: <em>\/pattern\/modifiers;<\/em><\/p>\n<p>For example: <code>var patt = \/webcodegeeks\/i<\/code> where:<\/p>\n<ul>\n<li><code>\/webcodegeeks\/i<\/code> is a regular expression.<\/li>\n<li><code>webcodegeeks<\/code> is a pattern (to be used in a search).<\/li>\n<li><code>i<\/code> is a modifier (modifies the search to be case-insensitive).<\/li>\n<\/ul>\n<h3><a name=\"application\"><\/a>1.3 Creating a regular expression<\/h3>\n<p>You construct a regular expression in one of two ways:<\/p>\n<p>Using a regular expression literal, which consists of a pattern enclosed between slashes, as follows:<\/p>\n<pre class=\"brush:js\">var re = \/ab+c\/;<\/pre>\n<p>Regular expression literals provide compilation of the regular expression when the script is loaded. When the regular expression will remain constant, use this for better performance.<\/p>\n<p>Or calling the constructor function of the RegExp object, as follows:<\/p>\n<pre class=\"brush:js\">var re = new RegExp(\"ab+c\");<\/pre>\n<p>Using the constructor function provides runtime compilation of the regular expression. Use the constructor function when you know the regular expression pattern will be changing, or you don&#8217;t know the pattern and are getting it from another source, such as user input.<\/p>\n<h2><a name=\"types\"><\/a>2. Types of Regular Expressions<\/h2>\n<p>Regular expressions can be divided in six groups of similar expressions.<\/p>\n<h3><a name=\"modifiers\"><\/a>2.1 Modifiers<\/h3>\n<p>Modifiers are used to perform case-insensitive and global searches:<\/p>\n<p><code>i<\/code> &#8211; Does a case-insensitive search for &#8220;webcodegeeks&#8221; in a string:<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Refer to WebCodeGeeks\";  \r\n    var patt1 = \/webcodegeeks\/i;    \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10789\" aria-describedby=\"caption-attachment-10789\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions1-1.jpg\" rel=\"attachment wp-att-10789\"><img decoding=\"async\" class=\"size-full wp-image-10789\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions1-1.jpg\" alt=\"i - Perform case-insensitive matching\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions1-1.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions1-1-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions1-1-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10789\" class=\"wp-caption-text\">i &#8211; Perform case-insensitive matching<\/figcaption><\/figure>\n<p><code>g<\/code> &#8211; Performs a global match (find all matches rather than stopping after the first match:<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"This is not what it is!\";\r\n    var patt1 = \/is\/g;    \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10707\" aria-describedby=\"caption-attachment-10707\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions2.jpg\" rel=\"attachment wp-att-10707\"><img decoding=\"async\" class=\"size-full wp-image-10707\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions2.jpg\" alt=\"g - Perform a global match\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions2.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions2-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions2-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10707\" class=\"wp-caption-text\">g &#8211; Perform a global match<\/figcaption><\/figure>\n<p><code>m<\/code> &#8211; Performs multi line matching. In this case we&#8217;re trying to get all &#8220;is&#8221; in the beginning of the line.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"\\nWhat is this? \\nIs it a cookie?\";\r\n    var patt1 = \/is\/m;    \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10711\" aria-describedby=\"caption-attachment-10711\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions3.jpg\" rel=\"attachment wp-att-10711\"><img decoding=\"async\" class=\"size-full wp-image-10711\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions3.jpg\" alt=\"m - Perform multiline matching\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions3.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions3-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions3-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10711\" class=\"wp-caption-text\">m &#8211; Perform multiline matching<\/figcaption><\/figure>\n<h3><a name=\"brackets\"><\/a>2.2 Brackets<\/h3>\n<p>Brackets are used to find a range of characters:<\/p>\n<p><code>[abc]<\/code> &#8211; Finds any character between the brackets.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Why are you still here?\";\r\n    var patt1 = \/[y]\/g;    \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<p><figure id=\"attachment_10787\" aria-describedby=\"caption-attachment-10787\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions4-1.jpg\" rel=\"attachment wp-att-10787\"><img decoding=\"async\" class=\"size-full wp-image-10787\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions4-1.jpg\" alt=\"[abc] - Find any character between the brackets\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions4-1.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions4-1-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions4-1-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10787\" class=\"wp-caption-text\">[abc] &#8211; Find any character between the brackets<\/figcaption><\/figure><code>[^abc]<\/code> &#8211; Finds any character NOT between the brackets.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Why are you still here?\";\r\n    var patt1 = \/[^y]\/g;    \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<p><figure id=\"attachment_10717\" aria-describedby=\"caption-attachment-10717\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions5.jpg\" rel=\"attachment wp-att-10717\"><img decoding=\"async\" class=\"size-full wp-image-10717\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions5.jpg\" alt=\"[^abc] - Find any character NOT between the brackets\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions5.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions5-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions5-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10717\" class=\"wp-caption-text\">[^abc] &#8211; Find any character NOT between the brackets<\/figcaption><\/figure><code>[0-9]<\/code> &#8211; Finds any digit between the brackets.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"123456789\";\r\n    var patt1 = \/[2-5]\/g;    \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<p><figure id=\"attachment_10719\" aria-describedby=\"caption-attachment-10719\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions6.jpg\" rel=\"attachment wp-att-10719\"><img decoding=\"async\" class=\"size-full wp-image-10719\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions6.jpg\" alt=\"[0-9] - Find any digit between the brackets\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions6.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions6-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions6-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10719\" class=\"wp-caption-text\">[0-9] &#8211; Find any digit between the brackets<\/figcaption><\/figure><code>(x|y)<\/code> &#8211; Finds any of the alternatives specified.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"web code geeks we code world wide\";\r\n    var patt1 = \/(code|web)\/g;    \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10725\" aria-describedby=\"caption-attachment-10725\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions8.jpg\" rel=\"attachment wp-att-10725\"><img decoding=\"async\" class=\"size-full wp-image-10725\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions8.jpg\" alt=\"(x|y) - Find any of the alternatives specified\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions8.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions8-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions8-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10725\" class=\"wp-caption-text\">(x|y) &#8211; Find any of the alternatives specified<\/figcaption><\/figure>\n<h3><a name=\"metacharacters\"><\/a>2.3 Metacharacters<\/h3>\n<p>Metacharacters are characters with a special meaning:<\/p>\n<p><code>.<\/code> &#8211; Finds a single character, except newline or line terminator.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"That's my hot hat!\";\r\n    var patt1 = \/(h.t)\/g;    \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10728\" aria-describedby=\"caption-attachment-10728\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions9.jpg\" rel=\"attachment wp-att-10728\"><img decoding=\"async\" class=\"size-full wp-image-10728\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions9.jpg\" alt=\". - Find a single character, except newline or line terminator\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions9.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions9-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions9-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10728\" class=\"wp-caption-text\">. &#8211; Find a single character, except newline or line terminator<\/figcaption><\/figure>\n<p><code>\\w<\/code> &#8211; Finds a word character.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Interest raised to 4.5%\";\r\n    var patt1 = \/\\w\/g;   \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10730\" aria-describedby=\"caption-attachment-10730\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions10.jpg\" rel=\"attachment wp-att-10730\"><img decoding=\"async\" class=\"size-full wp-image-10730\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions10.jpg\" alt=\"\\w - Find a word character\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions10.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions10-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions10-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10730\" class=\"wp-caption-text\">\\w &#8211; Find a word character<\/figcaption><\/figure>\n<p><code>\\W<\/code> &#8211; Finds a NON word character.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Interest raised to 4.5%\";\r\n    var patt1 = \/\\W\/g;   \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10732\" aria-describedby=\"caption-attachment-10732\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions11.jpg\" rel=\"attachment wp-att-10732\"><img decoding=\"async\" class=\"size-full wp-image-10732\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions11.jpg\" alt=\"\\W - Find a non-word character\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions11.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions11-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions11-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10732\" class=\"wp-caption-text\">\\W &#8211; Find a non-word character<\/figcaption><\/figure>\n<p>As you can see, all spaces, the comma and the percentage character are shown, because they are considered non-word.<\/p>\n<p><code>\\d<\/code> &#8211; Finds a digit.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"I'm 114 years old!\";\r\n    var patt1 = \/\\d\/g;   \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10734\" aria-describedby=\"caption-attachment-10734\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions12.jpg\" rel=\"attachment wp-att-10734\"><img decoding=\"async\" class=\"size-full wp-image-10734\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions12.jpg\" alt=\"\\d - Find a non-word character\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions12.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions12-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions12-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10734\" class=\"wp-caption-text\">\\d &#8211; Find a non-word character<\/figcaption><\/figure>\n<p><code>\\D<\/code> &#8211; Finds a non-digit character.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"I'm 114 years old!\";\r\n    var patt1 = \/\\D\/g;   \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10738\" aria-describedby=\"caption-attachment-10738\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions13-1.jpg\" rel=\"attachment wp-att-10738\"><img decoding=\"async\" class=\"size-full wp-image-10738\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions13-1.jpg\" alt=\"\\D - Find a non-digit character\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions13-1.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions13-1-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions13-1-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10738\" class=\"wp-caption-text\">\\D &#8211; Find a non-digit character<\/figcaption><\/figure>\n<p><code>\\s<\/code> &#8211; Finds a whitespace character.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"There is not much to show here\";\r\n    var patt1 = \/\\s\/g;   \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10740\" aria-describedby=\"caption-attachment-10740\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions14.jpg\" rel=\"attachment wp-att-10740\"><img decoding=\"async\" class=\"size-full wp-image-10740\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions14.jpg\" alt=\"\\s - Find a whitespace character\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions14.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions14-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions14-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10740\" class=\"wp-caption-text\">\\s &#8211; Find a whitespace character<\/figcaption><\/figure>\n<p><code>\\S<\/code> &#8211; Finds a non-whitespace character.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"There is not much to show here\";\r\n    var patt1 = \/\\S\/g;   \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10742\" aria-describedby=\"caption-attachment-10742\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions15.jpg\" rel=\"attachment wp-att-10742\"><img decoding=\"async\" class=\"size-full wp-image-10742\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions15.jpg\" alt=\"\\S - Find a non-whitespace character\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions15.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions15-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions15-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10742\" class=\"wp-caption-text\">\\S &#8211; Find a non-whitespace character<\/figcaption><\/figure>\n<p><code>\\b<\/code> &#8211; Finds a match at the beginning\/end of a word.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Visit WCG - WebCodeGeeks\";\r\n    var patt1 = \/\\bWCG\/g;   \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10744\" aria-describedby=\"caption-attachment-10744\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions16.jpg\" rel=\"attachment wp-att-10744\"><img decoding=\"async\" class=\"size-full wp-image-10744\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions16.jpg\" alt=\"\\b - Find a match at the beginning\/end of a word\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions16.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions16-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions16-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10744\" class=\"wp-caption-text\">\\b &#8211; Find a match at the beginning\/end of a word<\/figcaption><\/figure>\n<p><code>\\B<\/code> &#8211; Finds a match not at the beginning\/end of a word.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Visit WCG - WebCodeGeeks\";\r\n    var patt1 = \/\\BCode\/g;   \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10746\" aria-describedby=\"caption-attachment-10746\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions17.jpg\" rel=\"attachment wp-att-10746\"><img decoding=\"async\" class=\"size-full wp-image-10746\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions17.jpg\" alt=\"\\B - Find a match not at the beginning\/end of a word\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions17.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions17-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions17-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10746\" class=\"wp-caption-text\">\\B &#8211; Find a match not at the beginning\/end of a word<\/figcaption><\/figure>\n<p><code>\\0<\/code> &#8211; Finds a NUL character.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Visit WCG.\\0Learn JAVA\";\r\n    var patt1 = \/\\0\/;   \/\/ pattern\/modifier\r\n    var result = str.search(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10748\" aria-describedby=\"caption-attachment-10748\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions18.jpg\" rel=\"attachment wp-att-10748\"><img decoding=\"async\" class=\"size-full wp-image-10748\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions18.jpg\" alt=\"\\0 - Find a NUL character\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions18.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions18-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions18-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10748\" class=\"wp-caption-text\">\\0 &#8211; Find a NUL character<\/figcaption><\/figure>\n<p><code>\\n<\/code> &#8211; Finds a new line character.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Visit WebCodeGeeks. \\nLearn JAVA\";\r\n    var patt1 = \/\\n\/;   \/\/ pattern\/modifier\r\n    var result = str.search(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10750\" aria-describedby=\"caption-attachment-10750\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions19.jpg\" rel=\"attachment wp-att-10750\"><img decoding=\"async\" class=\"size-full wp-image-10750\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions19.jpg\" alt=\"\\n - Find a new line character\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions19.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions19-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions19-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10750\" class=\"wp-caption-text\">\\n &#8211; Find a new line character<\/figcaption><\/figure>\n<p><code>\\f<\/code> &#8211; Finds a form feed character.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Visit WCG. Learn\\f HTML\";\r\n    var patt1 = \/\\f\/;   \/\/ pattern\/modifier\r\n    var result = str.search(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10755\" aria-describedby=\"caption-attachment-10755\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions20.jpg\" rel=\"attachment wp-att-10755\"><img decoding=\"async\" class=\"size-full wp-image-10755\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions20.jpg\" alt=\"\\f - Find a form feed character\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions20.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions20-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions20-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10755\" class=\"wp-caption-text\">\\f &#8211; Find a form feed character<\/figcaption><\/figure>\n<p><code>\\r<\/code> &#8211; Finds a carriage return character.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Visit\\r WCG. Learn jQuery.\";\r\n    var patt1 = \/\\r\/;   \/\/ pattern\/modifier\r\n    var result = str.search(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10757\" aria-describedby=\"caption-attachment-10757\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions21.jpg\" rel=\"attachment wp-att-10757\"><img decoding=\"async\" class=\"size-full wp-image-10757\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions21.jpg\" alt=\"\\r - Find a carriage return character\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions21.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions21-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions21-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10757\" class=\"wp-caption-text\">\\r &#8211; Find a carriage return character<\/figcaption><\/figure>\n<p><code>\\t<\/code> &#8211; Finds a tab character.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Visit WCG. Learn CSS3 \\tfor free.\";\r\n    var patt1 = \/\\t\/;   \/\/ pattern\/modifier\r\n    var result = str.search(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10759\" aria-describedby=\"caption-attachment-10759\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions22.jpg\" rel=\"attachment wp-att-10759\"><img decoding=\"async\" class=\"size-full wp-image-10759\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions22.jpg\" alt=\"\\t - Find a tab character\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions22.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions22-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions22-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10759\" class=\"wp-caption-text\">\\t &#8211; Find a tab character<\/figcaption><\/figure>\n<p><code>\\v<\/code> &#8211; Finds a vertical tab character.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Visit WCG. Learn \\vAngularJS.\";\r\n    var patt1 = \/\\v\/;   \/\/ pattern\/modifier\r\n    var result = str.search(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10761\" aria-describedby=\"caption-attachment-10761\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions23.jpg\" rel=\"attachment wp-att-10761\"><img decoding=\"async\" class=\"size-full wp-image-10761\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions23.jpg\" alt=\"\\v - Find a vertical tab character\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions23.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions23-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions23-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10761\" class=\"wp-caption-text\">\\v &#8211; Find a vertical tab character<\/figcaption><\/figure>\n<p><code>\\xxx<\/code> &#8211; Finds the character specified by an octal number xxx.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Visit WebCodeGeeks. Learn programming.\";\r\n    var patt1 = \/\\127\/g;   \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10763\" aria-describedby=\"caption-attachment-10763\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions24.jpg\" rel=\"attachment wp-att-10763\"><img decoding=\"async\" class=\"size-full wp-image-10763\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions24.jpg\" alt=\"\\xxx - Find the character specified by an octal number xxx\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions24.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions24-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions24-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10763\" class=\"wp-caption-text\">\\xxx &#8211; Find the character specified by an octal number xxx<\/figcaption><\/figure>\n<p><code>\\xdd<\/code> &#8211; Finds the character specified by a hexadecimal number dd.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Visit WebCodeGeeks. Learn programming.\";\r\n    var patt1 = \/\\x57\/g;   \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10765\" aria-describedby=\"caption-attachment-10765\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions25.jpg\" rel=\"attachment wp-att-10765\"><img decoding=\"async\" class=\"size-full wp-image-10765\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions25.jpg\" alt=\"\\xdd - Find the character specified by a hexadecimal number dd\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions25.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions25-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions25-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10765\" class=\"wp-caption-text\">\\xdd &#8211; Find the character specified by a hexadecimal number dd<\/figcaption><\/figure>\n<p><code>\\uxxxx<\/code> &#8211; Finds the Unicode character specified by a hexadecimal number xxxx.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Visit WebCodeGeeks. Learn programming.\";\r\n    var patt1 = \/\\u0057\/g;   \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10767\" aria-describedby=\"caption-attachment-10767\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions26.jpg\" rel=\"attachment wp-att-10767\"><img decoding=\"async\" class=\"size-full wp-image-10767\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions26.jpg\" alt=\"\\uxxxx - Find the Unicode character specified by a hexadecimal number xxxx\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions26.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions26-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions26-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10767\" class=\"wp-caption-text\">\\uxxxx &#8211; Find the Unicode character specified by a hexadecimal number xxxx<\/figcaption><\/figure>\n<h3><a name=\"quantifiers\"><\/a>2.4 Quantifiers<\/h3>\n<p><code>n+<\/code> &#8211; Matches any string that contains at least one n.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Visit WebCodeGeeks. Learn programming.\";\r\n    var patt1 = \/\\u0057\/g;   \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10769\" aria-describedby=\"caption-attachment-10769\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions27.jpg\" rel=\"attachment wp-att-10769\"><img decoding=\"async\" class=\"size-full wp-image-10769\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions27.jpg\" alt=\"n+ - Matches any string that contains at least one n\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions27.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions27-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions27-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10769\" class=\"wp-caption-text\">n+ &#8211; Matches any string that contains at least one n<\/figcaption><\/figure>\n<p><code>n*<\/code> &#8211; Matches any string that contains zero or more occurrences of n.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Hello Lory\";\r\n    var patt1 = \/lo*\/g;   \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10770\" aria-describedby=\"caption-attachment-10770\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions28.jpg\" rel=\"attachment wp-att-10770\"><img decoding=\"async\" class=\"size-full wp-image-10770\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions28.jpg\" alt=\"n* - Matches any string that contains zero or more occurrences of n\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions28.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions28-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions28-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10770\" class=\"wp-caption-text\">n* &#8211; Matches any string that contains zero or more occurrences of n<\/figcaption><\/figure>\n<p><code>n?<\/code> &#8211; Matches any string that contains zero or one occurrences of n.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"1, 100 or 1000?\";\r\n    var patt1 = \/10?\/g;   \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10771\" aria-describedby=\"caption-attachment-10771\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions29.jpg\" rel=\"attachment wp-att-10771\"><img decoding=\"async\" class=\"size-full wp-image-10771\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions29.jpg\" alt=\"n? - Matches any string that contains zero or one occurrences of n\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions29.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions29-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions29-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10771\" class=\"wp-caption-text\">n? &#8211; Matches any string that contains zero or one occurrences of n<\/figcaption><\/figure>\n<p><code>n{X}<\/code> &#8211; Matches any string that contains a sequence of X n&#8217;s.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"100, 1000 or 10000?\";\r\n    var patt1 = \/\\d{4}\/g;  \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10772\" aria-describedby=\"caption-attachment-10772\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions30.jpg\" rel=\"attachment wp-att-10772\"><img decoding=\"async\" class=\"size-full wp-image-10772\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions30.jpg\" alt=\"n{X} - Matches any string that contains a sequence of X n's\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions30.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions30-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions30-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10772\" class=\"wp-caption-text\">n{X} &#8211; Matches any string that contains a sequence of X n&#8217;s<\/figcaption><\/figure>\n<p><code>n{X,Y}<\/code> &#8211; Matches any string that contains a sequence of X to Y n&#8217;s.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"100, 1000 or 10000?\";\r\n    var patt1 = \/\\d{4}\/g;  \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10773\" aria-describedby=\"caption-attachment-10773\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions31.jpg\" rel=\"attachment wp-att-10773\"><img decoding=\"async\" class=\"size-full wp-image-10773\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions31.jpg\" alt=\"n{X,Y} - Matches any string that contains a sequence of X to Y n's\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions31.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions31-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions31-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10773\" class=\"wp-caption-text\">n{X,Y} &#8211; Matches any string that contains a sequence of X to Y n&#8217;s<\/figcaption><\/figure>\n<p><code>n{X,}<\/code> &#8211; Matches any string that contains a sequence of at least X n&#8217;s.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"100, 10 or 10000?\";\r\n    var patt1 = \/\\d{3,}\/g;  \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10775\" aria-describedby=\"caption-attachment-10775\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions32.jpg\" rel=\"attachment wp-att-10775\"><img decoding=\"async\" class=\"size-full wp-image-10775\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions32.jpg\" alt=\"n{X,} - Matches any string that contains a sequence of at least X n's\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions32.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions32-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions32-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10775\" class=\"wp-caption-text\">n{X,} &#8211; Matches any string that contains a sequence of at least X n&#8217;s<\/figcaption><\/figure>\n<p><code>n$<\/code> &#8211; Matches any string with n at the end of it.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Is this his\";\r\n    var patt1 = \/is$\/g;  \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10776\" aria-describedby=\"caption-attachment-10776\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions33.jpg\" rel=\"attachment wp-att-10776\"><img decoding=\"async\" class=\"size-full wp-image-10776\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions33.jpg\" alt=\"n$ - Matches any string with n at the end of it\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions33.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions33-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions33-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10776\" class=\"wp-caption-text\">n$ &#8211; Matches any string with n at the end of it<\/figcaption><\/figure>\n<p><code>^n<\/code> &#8211; Matches any string with n at the beginning of it.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Is this his\";\r\n    var patt1 = \/^Is\/g;  \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10777\" aria-describedby=\"caption-attachment-10777\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions34.jpg\" rel=\"attachment wp-att-10777\"><img decoding=\"async\" class=\"size-full wp-image-10777\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions34.jpg\" alt=\"^n - Matches any string with n at the beginning of it\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions34.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions34-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions34-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10777\" class=\"wp-caption-text\">^n &#8211; Matches any string with n at the beginning of it<\/figcaption><\/figure>\n<p><code>?=n<\/code> &#8211; Matches any string that is followed by a specific string n.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Is this all there is\";\r\n    var patt1 = \/is(?= all)\/;  \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10778\" aria-describedby=\"caption-attachment-10778\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions35.jpg\" rel=\"attachment wp-att-10778\"><img decoding=\"async\" class=\"size-full wp-image-10778\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions35.jpg\" alt=\"?=n - Matches any string that is followed by a specific string n\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions35.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions35-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions35-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10778\" class=\"wp-caption-text\">?=n &#8211; Matches any string that is followed by a specific string n<\/figcaption><\/figure>\n<p><code>?!n<\/code> &#8211; Matches any string that is not followed by a specific string n.<\/p>\n<pre class=\"brush:js\">&lt;script type=\"text\/javascript\"&gt;\r\nfunction resultFunction() {\r\n    var str = \"Is this all there is\";\r\n    var patt1 = \/is(?! all)\/gi;  \/\/ pattern\/modifier\r\n    var result = str.match(patt1);  \/\/ result from matching\r\n    document.getElementById(\"result\").innerHTML = result; \/\/ set result to the paragraph\r\n}\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>The result after clicking the button which will trigger the paragraph text to be added, would be (in blue):<\/p>\n<figure id=\"attachment_10779\" aria-describedby=\"caption-attachment-10779\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions36.jpg\" rel=\"attachment wp-att-10779\"><img decoding=\"async\" class=\"size-full wp-image-10779\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions36.jpg\" alt=\"?!n - Matches any string that is not followed by a specific string n\" width=\"820\" height=\"159\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions36.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions36-300x58.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/js-regular-expressions36-768x149.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-10779\" class=\"wp-caption-text\">?!n &#8211; Matches any string that is not followed by a specific string n<\/figcaption><\/figure>\n<h2><a name=\"regexp\"><\/a>3. RegExp Object<\/h2>\n<h3><a name=\"properties\"><\/a>3.1 RegExp Object Properties<\/h3>\n<ul>\n<li><code>constructor<\/code> &#8211; returns the function that created the RegExp object&#8217;s prototype<\/li>\n<li><code>global<\/code> &#8211; checks whether the &#8220;g&#8221; modifier is set<\/li>\n<li><code>ignoreCase<\/code> &#8211; checks whether the &#8220;i&#8221; modifier is set<\/li>\n<li><code>lastIndex<\/code> &#8211; specifies the index at which to start the next match<\/li>\n<li><code>multiline<\/code> &#8211; checks whether the &#8220;m&#8221; modifier is set<\/li>\n<li><code>source<\/code> &#8211; returns the text of the RegExp pattern<\/li>\n<\/ul>\n<h3><a name=\"methods\"><\/a>3.2 RegExp Object Methods<\/h3>\n<ul>\n<li><code>compile()<\/code> &#8211; deprecated in version 1.5. Compiles a regular expression<\/li>\n<li><code>exec()<\/code> &#8211; tests for a match in a string. Returns the first match<\/li>\n<li><code>test()<\/code> &#8211; tests for a match in a string. Returns true or false<\/li>\n<li><code>toString()<\/code> &#8211; returns the string value of the regular expression<\/li>\n<\/ul>\n<h2><a name=\"conclusion\"><\/a>4. Conclusion<\/h2>\n<p>To conclude, a regular expression is a sequence of characters that forms a search pattern. When you search for data in a text, you can use this search pattern to describe what you are searching for. A regular expression can be a single character, or a more complicated pattern. Regular expressions can be used to perform all types of text search and text replace operations.<\/p>\n<h2><a name=\"download\"><\/a>5. Download the source code<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <strong><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/02\/Javascript-Regular-Expression.zip\">Javascript Regular Expression<\/a><\/strong><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Regular expressions are patterns used to match character combinations in strings. They are used to perform pattern-matching and &#8220;search-and-replace&#8221; functions on text. In JavaScript, regular expressions are also objects. JavaScript&#8217;s regular expression flavor is part of the ECMA-262 standard for the language. This means your regular expressions should work exactly the same in all implementations &hellip;<\/p>\n","protected":false},"author":75,"featured_media":920,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[328,327],"class_list":["post-10683","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-expression","tag-regular"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Javascript Regular Expressions Example - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"Regular expressions are patterns used to match character combinations in strings. They are used to perform pattern-matching and &quot;search-and-replace&quot;\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Javascript Regular Expressions Example - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"Regular expressions are patterns used to match character combinations in strings. They are used to perform pattern-matching and &quot;search-and-replace&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/fabiocimo\" \/>\n<meta property=\"article:published_time\" content=\"2016-02-09T14:15:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-01-10T14:16:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Fabio Cimo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fabiocimo\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fabio Cimo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"19 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/\"},\"author\":{\"name\":\"Fabio Cimo\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1dfb88b4a8d08c37a6080311fd330a22\"},\"headline\":\"Javascript Regular Expressions Example\",\"datePublished\":\"2016-02-09T14:15:31+00:00\",\"dateModified\":\"2018-01-10T14:16:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/\"},\"wordCount\":2205,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"keywords\":[\"expression\",\"regular\"],\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/\",\"name\":\"Javascript Regular Expressions Example - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"datePublished\":\"2016-02-09T14:15:31+00:00\",\"dateModified\":\"2018-01-10T14:16:13+00:00\",\"description\":\"Regular expressions are patterns used to match character combinations in strings. They are used to perform pattern-matching and \\\"search-and-replace\\\"\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Javascript Regular Expressions Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1dfb88b4a8d08c37a6080311fd330a22\",\"name\":\"Fabio Cimo\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b3df055f2e1b62e238889fafbb16121c68aab1adcd11af670e185cafae201b3b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b3df055f2e1b62e238889fafbb16121c68aab1adcd11af670e185cafae201b3b?s=96&d=mm&r=g\",\"caption\":\"Fabio Cimo\"},\"description\":\"Fabio is a passionate student in web tehnologies including front-end (HTML\/CSS) and web design. He likes exploring as much as possible about the world wide web and how it can be more productive for us all. Currently he studies Computer Engineering, at the same time he works as a freelancer on both web programming and graphic design.\",\"sameAs\":[\"https:\/\/www.facebook.com\/fabiocimo\",\"https:\/\/al.linkedin.com\/in\/fabiocimo\",\"https:\/\/x.com\/fabiocimo\",\"https:\/\/www.youtube.com\/fabiocimo1\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/fabio-cimo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Javascript Regular Expressions Example - Web Code Geeks - 2026","description":"Regular expressions are patterns used to match character combinations in strings. They are used to perform pattern-matching and \"search-and-replace\"","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:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/","og_locale":"en_US","og_type":"article","og_title":"Javascript Regular Expressions Example - Web Code Geeks - 2026","og_description":"Regular expressions are patterns used to match character combinations in strings. They are used to perform pattern-matching and \"search-and-replace\"","og_url":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_author":"https:\/\/www.facebook.com\/fabiocimo","article_published_time":"2016-02-09T14:15:31+00:00","article_modified_time":"2018-01-10T14:16:13+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","type":"image\/jpeg"}],"author":"Fabio Cimo","twitter_card":"summary_large_image","twitter_creator":"@fabiocimo","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Fabio Cimo","Est. reading time":"19 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/"},"author":{"name":"Fabio Cimo","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1dfb88b4a8d08c37a6080311fd330a22"},"headline":"Javascript Regular Expressions Example","datePublished":"2016-02-09T14:15:31+00:00","dateModified":"2018-01-10T14:16:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/"},"wordCount":2205,"commentCount":1,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","keywords":["expression","regular"],"articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/","url":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/","name":"Javascript Regular Expressions Example - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","datePublished":"2016-02-09T14:15:31+00:00","dateModified":"2018-01-10T14:16:13+00:00","description":"Regular expressions are patterns used to match character combinations in strings. They are used to perform pattern-matching and \"search-and-replace\"","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-regular-expressions-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/"},{"@type":"ListItem","position":3,"name":"Javascript Regular Expressions Example"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1dfb88b4a8d08c37a6080311fd330a22","name":"Fabio Cimo","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b3df055f2e1b62e238889fafbb16121c68aab1adcd11af670e185cafae201b3b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b3df055f2e1b62e238889fafbb16121c68aab1adcd11af670e185cafae201b3b?s=96&d=mm&r=g","caption":"Fabio Cimo"},"description":"Fabio is a passionate student in web tehnologies including front-end (HTML\/CSS) and web design. He likes exploring as much as possible about the world wide web and how it can be more productive for us all. Currently he studies Computer Engineering, at the same time he works as a freelancer on both web programming and graphic design.","sameAs":["https:\/\/www.facebook.com\/fabiocimo","https:\/\/al.linkedin.com\/in\/fabiocimo","https:\/\/x.com\/fabiocimo","https:\/\/www.youtube.com\/fabiocimo1"],"url":"https:\/\/www.webcodegeeks.com\/author\/fabio-cimo\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/10683","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/75"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=10683"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/10683\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/920"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=10683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=10683"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=10683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}