Directly on the code:
nsstring *string = @ " I am a big www.baidu.com mi mimi ";
nserror *error;
nsstring *regulastr = @ "\\b (?: https?:/ /|www\\d{0,3}[.]| [a-z0-9.\\-]+[.] [A-z] {2,4}/) (?: [^\\s () <>]+|\\ ([^\\s () <>]+| ( \ \ ([^\\s () <>]+\\))]) + (?: \ \ (([^\\s () <>]+| (\ \ ([^\\s () <>]+\\))] *\\)| [^\\s '! () \\[\\]{};: ' \ ".,<>???" ""]) "
nsregularexpression *regex = [nsregularexpression regularexpressionwithpattern: regulastr options:nsregularexpressioncaseinsensitive error :&error];
NSLog(@ "error:%@", error);
nsarray *arrayofallmatches = [Regex matchesinstring: String options: Nsmatchingreportcompletion Range:nsmakerange(0, [string length])];
for (nstextcheckingresult *match in arrayofallmatches)
{
nsstring* substringformatch = [string substringwithrange: Match. Range];
NSLog(@ "Substringformatch");
NSLog(@ "%@", Substringformatch);
}
Using the regular Fetch URL (iOS)