regex to match letters, numbers, certain symbols

Posted by Hintswen on Stack Overflow See other posts from Stack Overflow or by Hintswen
Published on 2010-05-26T13:28:17Z Indexed on 2010/05/26 13:31 UTC
Read the original article Hit count: 290

Filed under:
|

I need to validate a username in php, it can be:

  • Letters (upper and lower case)
  • Numbers
  • Any of these symbols :.,?!@
  • up to 15 characters OR 16 if the last character is one of the following #$^ (it can also be 15 or less with one of these 3 characters at the end only)

How do I do this?

© Stack Overflow or respective owner

Related posts about php

Related posts about regex