changed regex to more standard charCode instead of event.char