I have the following String
""00001","Open","2020-10-23 12:45","2022-10-20 15:48","Error not found","Alex Smith","NO ERROR","ErrorApp","FOB","CNSHA","GB","Plane","MODEL","2020-10-24 00:00","New","1","","2022-10-20 15:48""
I need to replace the 4th and the last words (dates) with an empty String "".
I have tried several regex expressions but couldn't get them to work.
The result should be:
""00001","Open","2020-10-23 12:45","","Error not found","Alex Smith","NO ERROR","ErrorApp","FOB","CNSHA","GB","Plane","MODEL","2020-10-24 00:00","New","1","","""
This regex:
actualLines[1].replaceAll("^(\".+?\",\".+?\",\".+?\",\")([0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2})(.*)$", "$1$3}");
It replaces the 4th, but I need both 4th and the last element to be replaced.
Does anyone know how this can be done? Thanks