Try this template: ^[A-Za-z0-9]*$
or ^[A-Za-z0-9]+$ to avoid empty results.
If you want to verify that the string contains only certain characters, you must add anchors ( ^ to start the string, $ to the end of the string) to make sure your pattern matches the entire string.
Curly braces should only write a quantity, for example: I want two a :
a{2}
You cannot insert letters inside. The only cases where you can find letters inside curly braces are when you use the Unicode character classes: \p{L} , \p{Greek} , \p{Arabian} , ...
Casimir et Hippolyte
source share