How to check if text entered in a input field is alphanumeric?

I am using a text field in my app and want to enable a button only if the text input is alphanumeric. How to check if the text entered in an input field is alphanumeric?

{{ !textInput1.value.match(/^[0-9a-z]+$/) }}

Simple as that or not?