length should be [2-10],
should accept [a-zA-z0-9],accept one space in between characters.
eg: timesheet 2
shanti chakra
shantichakra
shantichakra2
chaitu11
0
Junior Poster
Recommended Answers
Jump to PostWOuld replacing multiple spaces with a single space be any use?
$spaced = preg_replace('/ {2,}/', ' ', trim($inputString));
Jump to PostI got to this:
^[a-zA-Z0-9](?:[a-zA-Z0-9]|[ ](?=[^ ]*$)){0,8}[a-zA-Z0-9]$
Jump to PostE-mail is dangerous to do with a regex, as it allows for invalid ones to get through. There is no guarantee with such a check. It's much better to send a confirmation link to an e-mail address.
All 11 Replies
chaitu11
0
Junior Poster
chaitu11
0
Junior Poster
chaitu11
0
Junior Poster
diafol
chaitu11
0
Junior Poster
diafol
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
chaitu11
0
Junior Poster
chaitu11
0
Junior Poster
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.