Regex to check input is not empty plus it's alphanumeric?
regex
Solution
Simply use this regex to match a non-empty alphanumeric string:
^[a-zA-Z0-9]+$
Details
- `^` - string start
- `[a-zA-Z0-9]+` - one or more letters or digits
- `$` - string end.
Problem
I need a single regex to check if input must not be empty plus the input has alphanumeric characters only. I know the alphanumeric part,`^[\s+0-9a-zA-Z]+$`, but I am not sure about the not empty requirement. I can only use a single expression and I can't use any language function.