/^www. # string begins with www. [\w\-\.]* # followed by a letter (\w) or a - or a ., none or more times (*) \. # followed by . [A-Za-z] # followed by a letter [A-Za-z]+ # followed by a letter, one or more times (+)