Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > java.util.regex...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 16066 of 16078
Post > Topic >>

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




 3 Posts in Topic:
java.util.regex.Pattern method matches() fails in this context
"phillip.s.powell@[E  2008-05-08 13:41:11 
Re: java.util.regex.Pattern method matches() fails in this conte
Knute Johnson <nospam@  2008-05-08 15:30:48 
Re: java.util.regex.Pattern method matches() fails in this conte
Roedy Green <see_websi  2008-05-10 07:48:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 23:25:22 CDT 2008.