I have a webapp, where people signup and get a sub domain under this app domain ( xx.app.com ) ... for each subdomain there is a db that is attached to it grammatically and have the same name as the subdomain.
what i need is the right regex that works with the subdomain and off course a db name ( mysql if it matters ), it's supposed to be lowercase & the length between 6 and 20 and the only allowed character is the " - ", also numbers are banned ...
i tried many times but it always go bad, .. some like : /([a-z-]){6,20}/
Thanks in advance :)