09/07/27 22:13:30
>>53
import java.util.regex.*;
public class GoogleKeyword {
public static void main(String[] args) {
Pattern p = Pattern.compile("(?:\\?|&)q=(.*?)(?:&|$)");
Matcher m = p.matcher("URLリンク(www.google.co.jp)キーワード&lr=lang_ja&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:ja:official&client=firefox-a");
if(m.find()) System.out.println("keyword="+m.group(1));
else System.out.println("not found");
}
}