Basic regex matcher in javascript.