試圖得到一個HTML的結果:Java的正則表達式的Html
private static final String PATTERN = "(ReportSession=)[0-9A-Za-z]{24}";`
...
Pattern pattern = Pattern.compile(PATTERN);
Matcher matcher = pattern.matcher(".axd?ReportSession=frytm055l51aigbigh5xzrin\u");
if(matcher.find()){
textView1.setText(matcher.group(1));
}
輸出是ReportSession=
但我需要反斜槓之前得到整個ReportSession=frytm055l51aigbigh5xzrin
。有任何想法嗎?
+1解釋爲什麼原始解決方案不起作用。 – mthmulders 2013-04-08 09:58:27