For some reason I always get stuck making anything past extremely basic regular expressions.
I'm trying to make a regular expression that kind of looks like a URL. I only want basic checking.
I would like it to match the following patterns where X is "something".
X://X.X
X://X.X...
etc.
X.X
X.X...
etc
If the string contains one of these patterns, it is sufficient checking for me. This way a url like www.example.com:8888
will still match. I have tried many different REGEX combinations with preg_match
and cannot seem to get any to behave the way I want it to. I have consulted many other related REGEX questions on SO but my readings have not helped me.
Any help? I will be happy to provide more information if you would like but I don't know what else you would need.