- 54 名前:デフォルトの名無しさん mailto:sage [2009/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("www.google.co.jp/search?q=キーワード&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"); } }
|

|