In Windows file path should contain double backslash instead of a single one, for example: “C:\Target” instead of “C:\Target”.
I define a string variable with path to the target file:
SourceImageFilePath = "C:\Target\Image.tif"
and want to replace all backslashes to double backslashes:
replace(SourceImageFilePath, "\\", "\\\\");
However, this command gives the error:
Error: java.util.regex.PatternSyntaxException: Unexpected internal error near index 1
^ in line 60:
replace ( SourceImageFilePath , "\" , "\\" <)> ;
What is the reason for this error and how do I fix this?