Create preg_match

Javascript implementation for PHP preg_match() function