function match(pattern, val, flags){
  utils.assertType(pattern, 'string', 'pattern');
  utils.assertString(val, 'val');
  var re = new RegExp(pattern.val, validateFlags(flags) ? flags.string : '');
  return val.string.match(re);
}
retrieves the matches when matching a `val`(string)
against a `pattern`(regular expression).

Examples:
  $regex = '^(height|width)?([<>=]{1,})(.*)'

  match($regex,'height>=sm')
	 // => ('height>=sm' 'height' '>=' 'sm')
	 // => also truthy

  match($regex, 'lorem ipsum')
  // => null

@param {String} pattern
@param {String|Ident} val
@param {String|Ident} [flags='']
@return {String|Null}
@api public