File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes pattern matcher Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "pattern matcher" Watch "pattern matcher" New topic

pattern matcher

Shashank Sharma
Ranch Hand

Joined: Sep 27, 2006
Posts: 91

if I remove the comments then the the while lop does not print any thing..,,..
but the replaceAll method is not changing the original string but returning a new modified string.
please help..
Henry Wong

Joined: Sep 28, 2004
Posts: 20538

The replaceAll() method uses the find() method, and hence, already found everything. If you want to find again, then reset the matcher.


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
I agree. Here's the link:
subject: pattern matcher
It's not a secret anymore!