containsURl

fun String.containsURl(): Boolean

Whether this string matches a URL regex.

Samples


fun main() { 
   //sampleStart 
   /** A list of valid web URL regex */
    public val url: List<Regex> = listOf(
        "[-a-zA-Z0-9@:%._+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_+.~#?&//=]*)",
        "https?://(www\\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_+.~#?&//=]*)"
    ).map { it.toRegex() } 
   //sampleEnd
}