Salutations, I need a regular expression in which doesn't allow spaces or special characters. All replies are appreciated. Thank you.
For example, if somebody enters $cdIAb!%
, a bcd
, or $ab%c d@
, it would be rejected. If they entered cdIAb
it would be accepted.
This is for an Xenforo forum.
The regex express you would use is ^(\d|\w)+$
:
<form>
<input type="text" pattern="^(\d|\w)+$">
<button type="submit">submit</button>
</form>
Regex101 example.