isMatch = function(s, p) {
  let si = s.length - 1;

  for(let pi = p.length - 1; pi > 0; pi--) {
    switch(p[pi]) {
      case '.':
        if (si > 0) { si--; }
        else { return false; }
        break;
      case '*':
        const char = p[--pi];
        while(si > 0 && (char === '.' || char === s[si])) {
          si--;
        }
        break;
      default:
        if (si > 0 && p[pi] === s[si]) {
          si--;
        } else {
          return false;
        }
    }
  }

  return si <= 0;
}
https://leetcode.com/articles/regular-expression-matching/
Pattern:
'.' Matches any single character.
'*' Matches zero or more of the preceding element.

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