Update preg_match_all.js

Basic function, using Javascript's regex engine (hence it's not ideal) and doesn't support flag combination.
Needs more testing.