Answers for "javascript regex exact match"

0

javascript regex exact match

var r = /^a$/

function matchExact(r, str) {
   var match = str.match(r);
   return match && str === match[0];
}
Posted by: Guest on May-08-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language