Minimal javascript matcher implementation