Added the pattern matching JavaScript

This script is a pattern matching / regex tester in JavaScript.

See the comments for a further explanation.