Remove four specific lines in Notepad++ without delete similar lines



  • Is it possible to remove only the lines that say:

    $ ('. button'). css ({
         'position': 'absolute',
         'z-index': '-2'
         });
    

    I try but when I copy and paste them in notepad ++, only the first line is copied and if I copy them separately, similar lines will be deleted .ie }); Any ideas? Thanks!!!

    $('.button').css({
            'position': 'absolute',
                'z-index': '-2'
                    });
    
        $('.button').css({
            'position': 'absolute',
                'z-index': '-2'
                    });
    
        $('.div').css({
            'position': 'absolute',
                'z-index': '-1'
                    });
    


  • @ric12g

    Select those four lines in Notepad++ and press Ctrl+f.
    All of the line data will appear in the Find what box of the Find dialog, but it will appear to run together.

    Pressing Find Next at that point should find the block of four lines.

    From there you can proceed to a Replace operation, where you replace with nothing to effectively delete the lines.

    You probably want to make sure you get the line-ending on the 4th line in your original selection.

    If you’re trying to match similar but not exact matches (as your lower example hints at), then this is a slightly different problem. But rather than answer something you didn’t ask for, I’ll wait until that’s asked for. :-)


Log in to reply