I would have thought that as a fully-qualified Java man you would have got this one!!! It's actually very simple. You need to end up with the escape sequence \. for the regexp to the valid, but it doesn't work because the Java compiler sees it as an escape for its String objects, while a full-stop here does not require escaping - if you see what I mean. The work-around is to write "\\.". This way, the backslash is escaped on the first round (remember that a backslash must be escaped anyway), and on the second round (when involving regex), it is the full-stop which is escaped... Hope this helps! [ June 09, 2003: Message edited by: Charles Lyons ]
Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / AmazonAmazon UK )
Joined: Jun 03, 2003
Thanks Charles! It did occured to me at one point. But I did not give it a try, because I thought the Java's escape sequence is different from the pattern meta char set. Stupid me.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com