Paras Joshi :
use this bellow method\n\n- (BOOL) validateUrl: (NSString *) stringURL {\n NSString *urlRegEx =\n @\"(http|https)://((\\\\w)*|([0-9]*)|([-|_])*)+([\\\\.|/]((\\\\w)*|([0-9]*)|([-|_])*))+\";\n NSPredicate *urlTest = [NSPredicate predicateWithFormat:@\"SELF MATCHES %@\", urlRegEx]; \n return [urlTest evaluateWithObject:stringURL];\n}\n\n\nhope this help you...\n\n:)",
2012-09-14T07:27:27
Grzegorz Krukowski :
For anyone having problem with accepted answer regexpression here is a version I'm using:\n\n(https?)://(([\\\\w\\\\!\\\\@\\\\#\\\\$\\\\%\\\\^\\\\&\\\\*\\\\(\\\\)\\\\-\\\\+\\\\=\\\\(\\\\)\\\\[\\\\]\\\\{\\\\}\\\\?\\\\<\\\\>])*)+([\\\\.|/](([\\\\w\\\\!\\\\@\\\\#\\\\$\\\\%\\\\^\\\\&\\\\*\\\\(\\\\)\\\\-\\\\+\\\\=\\\\(\\\\)\\\\[\\\\]\\\\{\\\\}\\\\?\\\\<\\\\>])*))+\n\n\nThe problem with accepted answer regexp is that:\n\\w - already contains \"_\" and numbers\n\nit fails for URLs having \"-\" after first dot",
2015-08-06T10:44:25
Eran Goldin :
This will catch http / https / plain subdomain.domain.suffix links:\n(Based on the good answer by Grzegorz Krukowski)\n\n@\"((https?)://)?(([\\\\w\\\\!\\\\@\\\\#\\\\$\\\\%\\\\^\\\\&\\\\*\\\\(\\\\)\\\\-\\\\+\\\\=\\\\(\\\\)\\\\[\\\\]\\\\{\\\\}\\\\?\\\\<\\\\>])*)+([\\\\.|/](([\\\\w\\\\!\\\\@\\\\#\\\\$\\\\%\\\\^\\\\&\\\\*\\\\(\\\\)\\\\-\\\\+\\\\=\\\\(\\\\)\\\\[\\\\]\\\\{\\\\}\\\\?\\\\<\\\\>])+))+\"",
2016-01-13T15:38:12
Hiren :
Check out this one\n\nNSString *urlRegEx =\n@\"(http|https)://((\\\\w)*|([0-9]*)|([-|_])*)+([\\\\.|/]((\\\\w)*|([0-9]*)|([-|_])*))+\";\n",
2012-09-14T06:34:39