Updated regex match and added oninput