Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript regex exact match

var r = /^a$/

function matchExact(r, str) {
   var match = str.match(r);
   return match && str === match[0];
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #regex #exact #match
ADD COMMENT
Topic
Name
1+8 =