2013-04-08 28 views
0

試圖得到一個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

使用matcher.group(0)代替matcher.group(1)