• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

User Name Match Regular Expression

trilogy33

Well-known member
#1
How do I use the "User Name Match Regular Expression" to enforce?:

  • Alpha Numerics
  • No special charcters
  • Allow underscores

So in other words, same as twitter usernames like so...
Only use letters, numbers and '_'
 
F

Floris

Guest
#2
[a-z,A-Z,0-9]+_+^

or something. Can't confirm that works though :/ Server is doing heavy cpu work and my dev.area is very slow for the next ten minutes.
 

trilogy33

Well-known member
#4
Think I've cracked it.

^[a-zA-Z0-9_]+$

Can have alpha numerics and underscores.
Can not have special chars nor spaces.
Allows spaces at beginning and end of string, which is weird but not immediate.
 

DSF

Well-known member
#7
Don't forget: ö ä ü é à è Ö Ä Ü É À È as exemple ;)

My expression
^[a-zA-Z0-9_.-éèàöäüÖÄÜß\s]+$
 
F

Floris

Guest
#9
oops, i see my paste got buggered up (stupid webkit!)
yeah it's not [...]^+

but
^[]+$

^[a-zA-Z0-9_]+$
 
#13
Help me please to collect my Regular Expression.
I need:

1. prohibit the CAPS (more than 2 letters consecutive), allowing the first capital letters, such as "Mary Doe" or "Catherine"
2. prohibit any special characters such as * @ $% _- and so on. like ö ä ü é à è Ö Ä Ü É À È too
3. prohibit all digits 0-9
4. prohibit more than 2 consecutive identical letters
5. prohibit consisting total less than 3 characters
6. prohibit the kind of nickname "Ad " that is, when nick begins or ends with a space
7. Allow all Cyrillic and Latin

Thank you!
 

HWS

Well-known member
#14
Help me please to collect my Regular Expression.
I need:

1. prohibit the CAPS (more than 2 letters consecutive), allowing the first capital letters, such as "Mary Doe" or "Catherine"
2. prohibit any special characters such as * @ $% _- and so on. like ö ä ü é à è Ö Ä Ü É À È too
3. prohibit all digits 0-9
4. prohibit more than 2 consecutive identical letters
5. prohibit consisting total less than 3 characters
6. prohibit the kind of nickname "Ad " that is, when nick begins or ends with a space
7. Allow all Cyrillic and Latin

Thank you!
I am a regex specialist, but what you want is very advanced and would take some time to create and debug. If no one is willing to provide the solution for you here for free, you may think about hiring a specialist to do that. Sorry, I am not available for custom work but you may want to ask for it in the paid work forum.