Could the max and min attributes be used instead of the curly brackets?
It would take some research to answer your question as I am rather out of touch with Regex at this point. The old brain doesn’t retain as much as it once did. Who will do the research? Share your findings, please.
[a-zA-Z0-9]+ this syntax is quite confusing. Can we write it like [a-z A-z 0-9]+?
Regular expressions are nothing if not confusing for most people. Some patterns will look different and give the same results (almost) and some look almost the same and give completely different results. This is not on purpose, it is just the nature of learning to work around ‘pattern recognition’ with very powerful engine behind the scenes.
One supposes you could have whitespace but it alters your ‘class’ to include space character. We cannot think of patterns as a language, but expressions. In time one might get comfortable with RegEx, but it won’t come without a lot of study and practice. An awful lot, and if we walk away for a few months, be ready to start almost from scratch to rebuild one’s competence, again.
The class, [a-zA-Z0-9]+
matches to any lowercase alphabet, any uppercase alphabet, and any number digit. The quantifier after the class means ‘one or more’. We usually would not include space character in that class, but now you know you have.