java Regular expression matching html
Posted
by user121196
on Stack Overflow
See other posts from Stack Overflow
or by user121196
Published on 2010-05-08T00:17:15Z
Indexed on
2010/05/08
0:28 UTC
Read the original article
Hit count: 616
I want to match and capture the enclosing content of the <pre></pre> tag tried the following, not working, what's wrong?
String p="<pre>.*</pre>";
Matcher m=Pattern.compile(p,Pattern.MULTILINE|Pattern.CASE_INSENSITIVE).matcher(input);
if(m.find()){
String g=m.group(0);
System.out.println("g is "+g);
}
© Stack Overflow or respective owner