I created a URL Validation function that validates for URL as text is entered by a user into a text field.
However, in an effort to save performance and memory, I want to ignore entries that may contain common URL prefixes:
(i.e. http://, http://www, www, etc)
With that said, I want to be able to "smartly" ignore text that may MATCH one of these URL prefixes:
["http://www", "https://www", "www"]
i.e. If a user has typed "htt", it should be ignored since it is a substring of "http://www" or "https://www"
What is the best way to check if a string may match provided prefixes but not necessarily are equal?