File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Why Pattern is not working for spl cha..? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Why Pattern is not working for spl cha..?" Watch "Why Pattern is not working for spl cha..?" New topic
Author

Why Pattern is not working for spl cha..?

Naveen Raja
Greenhorn

Joined: Jul 28, 2006
Posts: 10
Hi Guys,

Could someone tell me why the following code is not working..?





Thanks a lot in Advance....

[ Edited to use code tags - Paul Sturrock ]
[ November 09, 2006: Message edited by: Paul Sturrock ]
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
Square brackets are special characters in regular expressions so they have to be escaped.

Alternatively you could use the Pattern.LITERAL flag


Or you could do this
All three forms produce the same result.


Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Naveen Raja
Greenhorn

Joined: Jul 28, 2006
Posts: 10
Thanks a lot Garrett Rowe....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why Pattern is not working for spl cha..?