Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove a certain line which has a certain variable using regex

    reportdoc.getAttributes().put(ATT_NAME, "report");
    reportdoc.getAttributes().put(ATT_PIXEL_SIZE, "64");

    clouddoc.getAttributes().put(ATT_NAME, "cloud");
    clouddoc.getAttributes().put(ATT_PIXEL_SIZE, "128");

I would like to remove the entire line in the above file which contains occurences of ATT_PIXEL_SIZE. What regex should I use in eclipse to search and remove the lines.

like image 548
Joe Avatar asked Feb 24 '23 02:02

Joe


1 Answers

For me this works

^.*ATT_PIXEL_SIZE.*\r\n

and replace with nothing. But I am not sure, can be that you need another linebreak like only \r or \n.

$ will not work because this is a zero width assertion, it will only match between the last character and the end of row, but not the end of row itself.

like image 145
stema Avatar answered Feb 26 '23 14:02

stema