Username regular expression in php
I'm creating a login system with PHP and I don't know how to set a regular expression for the "username" field. I created this regex but I'm not sure it works properly: /([A-Za-z0-9-_.])\w+/ Actually, I don't understand what w+ stand for...
- Can includes letters (a-z, A-Z) and numbers,
- Can includes periods (dot, I don't know how to call it but it's the symbol .)
- Can includes underscore
- Can includes minus symbol (-)
- No matter how username starts (in other words, no matter which is the first letter).
Can anyone help me, please?