Is not perfect, but most URLs should match it.
What is a good regular expression to match a URL?
Currently I have an input box which will detect the URL and parse the data. So right now, I am using: var urlR = /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+) (?::(\d+))?(?:\/([^?#]*))...
stackoverflow.com
B4X:
Private Sub isURL(url As String) As Boolean
Return Regex.IsMatch("(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})$",url)
End Sub
Example:
If isURL("https://stackoverflow.com/a/17773849") = True Then
Log("valid URL")
Else
Log("is not a URL")
End If