IN Swift i am using regular expression for checking "WWW" and "HTTP" Both , But in my code its only check for http when i put "www.google.com" then its show not valid please give me solution.Here is my code. how to check url when we not put http.
func validateUrl (stringURL : NSString) -> Bool {
let urlRegEx = "(http|https)://((\\w)*|([0-9]*)|([-|_])*)+([\\.|/]((\\w)*|([0-9]*)|([-|_])*)+)+(/)?(\\?.*)?"
let predicate = NSPredicate(format:"SELF MATCHES %@", argumentArray:[urlRegEx])
let urlTest = NSPredicate.predicateWithSubstitutionVariables(predicate)
print(urlTest);
return predicate.evaluateWithObject(stringURL)
}