Check If String is a URL

Usage

is.url(x)

Arguments

x
A character string.

Value

Returns a logical evalution as to whether a string is a url.

Description

Uses a regex approach to check if a string is a url. This approach is faster than url.exists but does do the actual verification.

Examples

urls <- c("a", "f/g/h", "www.talkstats.com", "https://github.com/trinker") is.url(urls)
[1] FALSE FALSE TRUE TRUE

See also

url.exists