aspose 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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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..?
 
Similar Threads
How to Replace a substring with another..??
Hibernate/Spring/Oracle: Problem acessing objects from a query
A teaser
JUnit on eclipse
Comparing dates in hibernate