Android アプリケーションを開発しており、EditText 内のリンクを認識したいと考えています。Objective-C で動作する次のコードがあり、それを Java で実行したいと考えています。私はそれがベクトル(文字列リンク[])で行われると思いますが、わかりません。
NSError *qwerror = nil;
NSRegularExpression *qwregex = [NSRegularExpression regularExpressionWithPattern:@"(http://\\w+.\\w+.\\w+.\\w+.\\w+.)" options:0 error:&qwerror];
NSArray *qwmatches = [qwregex matchesInString:textView.text options:0 range:NSMakeRange(0, textView.text.length)];
NSMutableArray *qwwords = [NSMutableArray array];
for (NSTextCheckingResult *qwmatch in qwmatches) {
NSRange qwwordrange = [qwmatch rangeAtIndex:1];
NSString *qwword = [textView.text substringWithRange:qwwordrange];
[qwwords addObject:qwword];
}
NSString *allLinks = [qwwords componentsJoinedByString:@" "];