// ==UserScript==
// @name        SubScene Filter
// @namespace   www.subscene.com
// @description Add filter to subscene searches
// @include     https://*subscene.com/subtitles/*
// @exclude     https://*subscene.com/subtitles/title?q*
// @exclude     https://*subscene.com/subtitles/*/*
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @version     1
// @grant       none
// ==/UserScript==
$("#flagWrapper").after('<div><input id="myfilterquery" type="text"><button id="mytoggle" type="button">Toggle</button></div>');
var rows = $("tr").filter(function(ix,el) {
  return $(this).find("span.l").text();
});
$("#mytoggle").click(function() {
  rows.filter(function(ix,el) {
    return $(this).find("span.l").text().trim() != "English";
  })
    .hide();
});
$("#myfilterquery").submit(function() {
  var isValid = true;
  try {
    var inputRegex = new RegExp($(this).val());
  } catch(e) {
    isValid = false;
  }

  if(!isValid) {
    window.console.log("Regex not valid");
    return $(this);
  }

  rows.filter(function(ix,el) {
    return ! $(this).children("td.a1 a span:nth-child(2)").text().trim().match(inputRegex);
  })
    .hide();
});

@@ -418,16 +418,17 @@
 cript==%0A
+%0A
 $(%22#flag
@@ -450,16 +450,56 @@
 ('%3Cdiv%3E%3C
+button id=%22langToggle%22%3EEnglish%3C/button%3E%3C
 input id
@@ -502,23 +502,23 @@
 t id=%22my
-f
+F
 ilter
-q
+Q
 uery%22 ty
@@ -539,24 +539,28 @@
 ton id=%22
-mytoggle
+filterButton
 %22 type=%22
@@ -567,22 +567,22 @@
 button%22%3E
-Toggle
+Filter
 %3C/button
@@ -688,11 +688,13 @@
 $(%22#
-myt
+langT
 oggl
@@ -840,30 +840,28 @@
 $(%22#
-my
 filter
-query%22).submit
+Button%22).click
 (fun
@@ -934,20 +934,32 @@
 egExp($(
-this
+%22#myFilterQuery%22
 ).val())
@@ -1074,20 +1074,32 @@
 eturn $(
-this
+%22#myFilterQuery%22
 );%0A  %7D%0A%0A

Separate actions into multiple buttons