The control is not going into the if loop...is the reg expr wrong? I am trying to check if there is a * or a ~ with a space before and after in the keyword. If yes then replace all such occurrences with a space.
SCJP 1.4, SCWCD 1.4<br /> <br />Thanks in advance!<br />Jayashree.
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 TestApplet 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 / AmazonAmazon UK )
JayaSiji, don't take this the wrong way, but it seems you work with regexes a lot, yet you don't take the time to learn them. That way, you keep relying on other people doing your work. I highly recommend you start learning this stuff yourself.