Alpha1 Well-known member Feb 12, 2017 #1 I want to force my members to type at least 5 different characters in a custom user field. Is there a regex statement I can use?
I want to force my members to type at least 5 different characters in a custom user field. Is there a regex statement I can use?
tenants Well-known member Feb 12, 2017 #2 Give this a go /^[a-zA-Z0-9 ]{5,}$/ or ^[a-zA-Z0-9 ]{5,}$ Tested here https://regex101.com/r/sN7tX4/4 matches alphanumeric (and space), must match 5 or more times before the end of the string Test it, I'm just guessing, I haven't used regex on custom fields, and regex isn't my strongest point (it drives me crazy) Last edited: Feb 12, 2017 Upvote 0 Downvote
Give this a go /^[a-zA-Z0-9 ]{5,}$/ or ^[a-zA-Z0-9 ]{5,}$ Tested here https://regex101.com/r/sN7tX4/4 matches alphanumeric (and space), must match 5 or more times before the end of the string Test it, I'm just guessing, I haven't used regex on custom fields, and regex isn't my strongest point (it drives me crazy)
X Xon Well-known member Feb 13, 2017 #3 This doesn't prevent character re-use, but that quickly becomes an insane regex (but should be vaguely doable with backreferences) Upvote 0 Downvote
This doesn't prevent character re-use, but that quickly becomes an insane regex (but should be vaguely doable with backreferences)
EQnoble Well-known member Feb 13, 2017 #4 Alfa1 said: I want to force my members to type at least 5 different characters in a custom user field. Is there a regex statement I can use? Click to expand... What is the exact formula you need. Is what you wrote the only considerations, what are the limitations for characters (alpha, numeric, are they case sensitive where "A" and "a" are different)? Upvote 0 Downvote
Alfa1 said: I want to force my members to type at least 5 different characters in a custom user field. Is there a regex statement I can use? Click to expand... What is the exact formula you need. Is what you wrote the only considerations, what are the limitations for characters (alpha, numeric, are they case sensitive where "A" and "a" are different)?