Can you restrict the ^ character?

As the title says, I have a normal input text field and would like just alphanumeric characters to be entered.

I use the code below, however it still allows the “^” character to be entered.

input_txt.restrict = "A-z0-9";