3

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>

1 Answer 1

5

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the sweet tip - makes it so much easier to use the Regular Expression stuff.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.