Home:ALL Converter>Assistance with understanding complicated REGEX string

Assistance with understanding complicated REGEX string

Ask Time:2021-03-25T10:00:36         Author:Meurant Naude

Json Formatter

We are currently looking into migrating python 2 code to python 3. In the code we are looking at there is a regex being done and for the life of me I can't figure out what the regex string means. I'm hoping that there someone out there that can help me decypher the regex string. Here's the code snippet

String findString ="(?<=((?<!\\\\)(\\\\\\\\){0,500}))\\\\\"";
String replaceString = "\"\"";
try {
....
      p.apply(Regex.replaceAll(findString, replaceString))
....

} catch (Exception e) {
    LOG.error(e.getMessage());
    throw e;
  }
....
}

Author:Meurant Naude,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/66792013/assistance-with-understanding-complicated-regex-string
yy