I allow the user to create their own profile on my site so that they can choose what their URL will be. So, for example, if their name is John Smith, they may want to log in to john-smith, and then their profile URL will be www.mysite.com/john-smith.
I need to use preg_match to verify that what they enter is a valid url. So, here are the rules that he must follow in order to be valid:
it must contain at least one letter and contain only letters, numbers and hyphens
Can someone help me, please, I'm good at PHP, but trash with regex!
source share