I’m writing a file renamer program in java. The issue is when giving input pattern.
When the input is complex like (][) in that case, I’m getting errors by java.util.regex.Pattern class..
The major issue of writing this code is that the input pattern and replacement pattern are user input. How can I handle such characters during processing ???
This is an example of how one can escape the special RegExp characters in the Java source code. I believe that you will have to escape the special characters manually if the pattern is being entered by a user.