java.util.regex.Pattern method matches() fails in this context
by "phillip.s.powell@[EMAIL PROTECTED]
" <phillip.s.powell@[EMAIL PROTECTED]
>
May 8, 2008 at 01:41 PM
<%
String stuff = "<c:import url=\"/common/lib\" context=\"common\" /
>";
if (Pattern.matches("context=\"", stuff)) {
out.println("the line has a match");
} else {
out.println("the line does not have a match");
}
%>
The following bit of JSP appears to constantly fail no matter how many
times I run it. I am simply looking for the pattern context=" and
replacing it with context="/ throughout an entire String value, but
my regular expression appears to be wrong.
Could someone help me figure out what the right expression would be?
Phil