{"id":9877,"date":"2015-04-18T23:41:40","date_gmt":"2015-04-18T23:41:40","guid":{"rendered":"http:\/\/www.oracletutoring.ca\/blog\/?p=9877"},"modified":"2018-11-14T05:00:15","modified_gmt":"2018-11-14T05:00:15","slug":"javascript-regular-expressions","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/javascript-regular-expressions\/","title":{"rendered":"Javascript:  regular expressions"},"content":{"rendered":"<h1>The tutor introduces Javascript regex.<\/h1>\n<p>Regex, aka regular expressions, is a programming concept.  One regex function searches input for a given pattern, then reports presence or absence.  Another, upon finding the pattern, might change it among the rest of the input &#8211; or else remove the pattern.<\/p>\n<p>The input field below accepts user input.  Then, when the button is clicked, a Javascript regex function weeds the non-numeric characters from the input.  The input, weeded of non-numeric characters, is reported beneath the button.<br \/>\n<script src=\"\/..\/javascripts\/regex.js\"><\/script><br \/>\n<input type=\"text\" id=\"field\"\/><br \/>\n<br \/>\n<button onclick=\"digitsonly()\">click here to remove non-numeric characters<\/button><\/p>\n<p>Weeded input: <span id=\"output\"><\/span><\/p>\n<p>I&#8217;ll be explaining the workings behind this utility in a future post:)<\/p>\n<p>Source:<\/p>\n<p><a href=\"http:\/\/www.w3schools.com\/jsref\/jsref_replace.asp\">w3schools.com<\/a><\/p>\n<p>Jack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The tutor introduces Javascript regex. Regex, aka regular expressions, is a programming concept. One regex function searches input for a given pattern, then reports presence or absence. Another, upon finding the pattern, might change it among the rest of the &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/javascript-regular-expressions\/\"> <span class=\"screen-reader-text\">Javascript:  regular expressions<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105],"tags":[205,711,710,709],"class_list":["post-9877","post","type-post","status-publish","format-standard","hentry","category-computer-science","tag-javascript","tag-javascript-regex","tag-regex","tag-regular-expressions"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/9877","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/comments?post=9877"}],"version-history":[{"count":13,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/9877\/revisions"}],"predecessor-version":[{"id":36160,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/9877\/revisions\/36160"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=9877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=9877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=9877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}