         else
           current_word += char
       when 'tag'
-        if current_word is '<script'
+        if is_script_tag current_word
           mode = 'script'
           current_word += char
         else if is_end_of_tag char

      when 'script'
        if is_end_of_tag char
          current_word += '>'
          end = current_word.substr current_word.length - 9
          if end is '</script>'
            words.push current_word
            current_word = ''
            if is_whitespace char

is_whitespace = (char)-> /^\s+$/.test char
is_tag = (token)-> /^\s*<[^>]+>\s*$/.test token
isnt_tag = (token)-> not is_tag token
is_script_tag = (token) -> token is '<script'
ends_in_end_script_tag = (token) -> 
  token_end = token.substr token.length - 9
  token_end is '</script>'

class Match
  constructor: (@start_in_before, @start_in_after, @length)->
