IbrahimMitko
IbrahimMitko

Reputation: 1207

Find/Replace multiple lines of code in Eclipse

How do I replace 20+ lines of JavaScript code in Eclipse? I can find and replace one line at a time but not multiple lines at once. I need to completely remove this block of code from all of my files:

<!-- /BoldChat Live Chat Button HTML v4.00 --></li>

        <li><a href="index.jsp">Contact Us</a></li>

        <li class="login-mega last"><a href="../user_profile.jsp"></a>
        <div class="login-mega-main">
            <div class="login-options">
            <form id="login" name="j_security_form" action="/public/j_security_check" method="post" accept-charset="UTF-8">
            <strong>Account Login</strong><br>
            Username:<br>
            <input type="text" name="j_username"><br>
            Password:<br>
            <input type="text" name="j_password"><br>
            <br>
            <input type="submit" value="Login"><br>
            <br>
            New users <a href="../user_registration.jsp">register here</a><br>
            <a href="../forgot_password.jsp">Forgot password?</a>
            <input type="hidden" name="auth_mode" value="basic">        
            <script>
            var newloc = document.location.href;
            newloc =newloc.replace('index.jsp','index.jsp');
            document.write('<input type="hidden" name="orig_url" value="'+newloc+'">');
            </script>
            </form>
            </div>
        </div>      
        </li>

Upvotes: 3

Views: 4274

Answers (1)

user4126820
user4126820

Reputation:

You have to make sure the "Regular Expression" is checked in the Search criteria.

RegExp

When you highlight the item you want to search for, CTRL+H will bring up the search window and if Reg Exp is checked then Eclipse automatically creates a Regular Expression to search for. Then you can replace within your file system.

Upvotes: 5

Related Questions