Jonny Borges
Committed by GitHub

Merge pull request #2585 from alindeman/isurl-tld

Support TLDs of up to 7 characters
... ... @@ -206,7 +206,7 @@ class GetUtils {
/// Checks if string is URL.
static bool isURL(String s) => hasMatch(s,
r"^((((H|h)(T|t)|(F|f))(T|t)(P|p)((S|s)?))\://)?(www.|[a-zA-Z0-9].)[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,6}(\:[0-9]{1,5})*(/($|[a-zA-Z0-9\.\,\;\?\'\\\+&%\$#\=~_\-]+))*$");
r"^((((H|h)(T|t)|(F|f))(T|t)(P|p)((S|s)?))\://)?(www.|[a-zA-Z0-9].)[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,7}(\:[0-9]{1,5})*(/($|[a-zA-Z0-9\.\,\;\?\'\\\+&%\$#\=~_\-]+))*$");
/// Checks if string is email.
static bool isEmail(String s) => hasMatch(s,
... ...
... ... @@ -213,6 +213,7 @@ void main() {
'http://appliance.example.com/bee/badge',
'http://www.example.org/berry.aspx',
'http://example.org/',
'http://birds.example/',
];
for (final url in urls) {
... ...