A typical reason for regex too complicated is when the target string is > 1 MB
The String class has three methods:
- someString.replace(target,replacement)
someString.replace(target,replacement)
- someString.replaceAll(regex,replacement)
someString.replaceAll(regex,replacement)
- someString.replaceFirst(regex,replacement)
someString.replaceFirst(regex,replacement)
Your application is trying to replace data:image/png;base64,
with simply ,
If your application is OK with replacing all of data:image/png;base64,
with ,
, then use the replace(target,replacement)
method as it doesn't use regex
Example:
someString.replace('data:image/png;base64,',',');