Hi all,
I am parsing text from a text file and I use Pattern and Matcher for the majority of the matching. My problem comes when I use the String.matches( String) function. Some of the lines have unclosed parentheses or unopened parentheses and These will throw the regex.PatternSy ntaxException ... some sort of exception. I have handled these but I was wondering if there was a way to ignore the parentheses or if I have to just handle the errors as they pop up?
An example of the function how I use it:
[Code="JAVA"]
String tester = "ralph";
String testee = "ralph)";
if(tester.match es(testee)){
//Do SOmething Brilliant
}
[/Code]
I am parsing text from a text file and I use Pattern and Matcher for the majority of the matching. My problem comes when I use the String.matches( String) function. Some of the lines have unclosed parentheses or unopened parentheses and These will throw the regex.PatternSy ntaxException ... some sort of exception. I have handled these but I was wondering if there was a way to ignore the parentheses or if I have to just handle the errors as they pop up?
An example of the function how I use it:
[Code="JAVA"]
String tester = "ralph";
String testee = "ralph)";
if(tester.match es(testee)){
//Do SOmething Brilliant
}
[/Code]
Comment