I'm confused with your
pattern. Why do you have " \\s+". That means match 2 or more spaces---is that what you intended? If not, omit the extra space. Also why do you have "\\[" as that's a literal "[" so the character class won't apply... I think you really mean:
If I were you, I'd use the
Regex Test Applet to test your expressions before putting them in a
Java app.
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 / Amazon Amazon UK )