Probably some easy answer out there, but I wasn’t able to find it. I am using RegexKitLite to manipulate some NSStrings in my iPhone app. I want to get the set of links from an entire HTML source from a webpage. I want it to return the array of links, not the rest.
My code:
NSString *regex = @"[0-9]{1,}.htm";
for (NSString *match in [sourcePage componentsSeperatedByRegex: regex]{
NSLog (@"%@", match); // Just to debug, will use data later.
}
The problem here is that the enire page is returned in small pieces, but exactly without the strings I want.
Any help is appreciated!
Use
-componentsMatchedByRegex:instead.