Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a regular expression that works in Notepad++ to remove multiline javascript references in several hundred HTML files. The code I want to remove looks like this:

<script type="text/javascript" language="JavaScript">
function ehlp_showtip(current,e,text)
  if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == 'Netscape'))
    document.tooltip.document.write("<layer bgColor='yellow' style='border:1px solid black;font-size:12px;'>"+ text + "<\/layer>");
function ehlp_hidetip()
<script type="text/javascript" language="JavaScript">
function reDo() {
  if (innerWidth != origWidth || innerHeight != origHeight)
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
        origWidth = innerWidth;
        origHeight = innerHeight;
        onresize = reDo;
onerror = null; 

Obviously I want to replace everything from <script type="text/javascript" language="JavaScript"> to the closing script tag.

Let me know if you need more info.

share|improve this question
On a lighter note:… – Nifle Dec 3 '12 at 21:35
up vote 1 down vote accepted

According to this post recent versions of notepad++ can deal with multi-line regexes. So, if you have the option:

[ ] . matches newline

select it and try this regex:


Backup your files before doing this, I don't use notepad++ (I prefer the glorious thing that are regexes in Perl or emacs :)) so I can't test it.

share|improve this answer
for some reason that is only matching single lines even tho I have the '. matches newline' option checked :( – Richie086 Dec 2 '12 at 21:45
Do you have 'Regular expression' checked. I've just tried this and it works in the latest version of Notepad++. – snowdude Dec 3 '12 at 15:23
@Richie086, just making sure you get snowdude's comment. – terdon Dec 3 '12 at 15:37
I had to modify this slightly, but overall I was able to make it work for my purposes. Thanks for answering. – Richie086 Dec 3 '12 at 21:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.