Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 219 Bytes

regular-expression-matching.md

File metadata and controls

18 lines (13 loc) · 219 Bytes

SOLUTION

/**
 * @param {string} s
 * @param {string} p
 * @return {boolean}
 */

var isMatch = function(s, p) {
  var p = '^' + p + '$';
  var pattern = new RegExp(p, 'g');
  return pattern.test(s);
};