i am parsing some text files in which the escape character is ? - There is also 4 escaped characters : + ' : ? . I think the clear escaping was working fine ( might be wrong tho ) until i added spring batch. Now when i try to launch the parsing of the file, this is failing and i don't get why.
Here is the error :
java.util.regex.PatternSyntaxException: Unknown inline modifier near index 6
(\?)(?|:|\+|')
And there is the code
private String regex = "(\\?)(?|:|\\+|')";
private String clearEscaping(String s){
return s.replaceAll(regex, "$2");
}
Can someone explain me why this is not working ? And how should i fix the issue ? Is there any more efficient way to do the escape clearing ?