I want to extract the number 81698
from the string below, however I am running into some difficulties.
Here is my code.
NSString *content = @"... list.vars.results_thpp = 32;
list.vars.results_count = 81698;
list.vars.results_board = '12'; ...";
NSError *error = NULL;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"results_count.*[0-9*];"
options:NSRegularExpressionCaseInsensitive
error:&error];
NSString *modifiedString = [regex stringByReplacingMatchesInString:content
options:0
range:NSMakeRange(0, [content length])
withTemplate:@"$1"];
The output is this
... list.vars.results_thpp = 32;
list.vars.
list.vars.results_board = '12'; ...
But I just want 81698
What am I doing wrong?