Possible Duplicate:
Php function to determine if a string consist of only alphanumerical characters?
I need to validate the string using PHP and regexpresisons
string can be min. 4 chars, up to 64 and needs to be only aplphanumeric
all I got so far:
/^[A-Za-z0-9]{4,64}$/
Your regex is correct (assuming you only want to match ASCII alphanumerics), so you’re probably using it incorrectly. To check whether a string
$subjectmatches this regex, useNote the
/ioption to make the regex case-insensitive. If you also want to match other letters/digits, use/^[\p{L}\p{N}]{4,64}$/as your regex.