Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Regex problem - question mark

807580Aug 30 2010 — edited Aug 30 2010
Hi!


How to search the string which contains a question mark character?

for example there is a string:

String string="http://www.mydomain.com/results?query=v&aq=f";
I want to search the following text into the string :
"results?query=v"
but the find result is false!

After that I was trying to change the searched text to:
"results\?query=v"
but I get an error this time:
illegal escape character
Can somebody help me?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 27 2010
Added on Aug 30 2010
1 comment
138 views