changes for IE9+

- IE9+ seems to return undefined for regex callback capture values,
instead of a blank string, added a check to see if the value is
"undefined" as well