#define reg(x) [x firstMatchInString:[contArr objectAtIndex:i] options:0 range:NSMakeRange(0, [[contArr objectAtIndex:i]length])] }else if([[typeArr objectAtIndex:i]isEqualToString:@"video"]){ NSError *error; NSRegularExpression *wpat=[NSRegularExpression regularExpressionWithPattern:@"width=['\"]?([0-9]+)" options:0 error:&error]; NSRegularExpression *hpat=[NSRegularExpression regularExpressionWithPattern:@"height=['\"]?([0-9]+)" options:0 error:&error]; if(error) NSLog(@"error."); else{ NSTextCheckingResult *wmatch=reg(wpat),*hmatch=reg(hpat); NSLog(@"w:%@ / ",[[contArr objectAtIndex:i]substringWithRange:[wmatch rangeAtIndex:1]]); NSLog(@"h:%@",[[contArr objectAtIndex:i]substringWithRange:[hmatch rangeAtIndex:1]]); } }
できた。perlとかと比べて正規表現の処理にエレガントさがない。あとはUIWebView貼るだけ。ようやくここまで来た。
夜は三く@新福島でかけ並ごはん。煮干系はなかなか外れがない。美味い。ちなみにボクサーの井岡さんとエンカウントしてシールもらった。このシール中津の弥七でも貼ってたしラーメン好きなんかな。