I need to find with the regular expression domain names that don't start with the string "http". For example:
- https://domain1.com -> Don't match
- http://domain2.com -> Don't match
- domain3.com -> Match
- domain4.co.uk -> Match
I found a regex that almost got this:
(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]{,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}
But it also detects "https://domain1.com"
Example given:
https://regex101.com/r/DjDBrx/1/
In this example I want to avoid "https://domain1.com"
Any help would be gratefully appreciated.
/^(?!http)/or/\b(?!http)/? I don't understand the{,61}and{2,6}, and your pattern has nohttpin it, so it seems to have nothing to do with your written specification.\b(?<!https:\/\/)(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}\b, a lookbehind with word boundaries.