Skip to content

Instantly share code, notes, and snippets.

@lqueryvg
Last active December 26, 2015 10:49
Show Gist options
  • Save lqueryvg/7139421 to your computer and use it in GitHub Desktop.
Save lqueryvg/7139421 to your computer and use it in GitHub Desktop.
PuTTYCS Filter Generator
$(document).ready(function () {
$("#doit_button").click(function () {
var input_text = $("#textarea").val();
var values_arr = input_text.match(/\S+/g);
$("#result_text").text("+" + values_arr.join("*;+") + "*");
});
});
<!DOCTYPE html>
<h3>PuTTYCS Filter Generator</h3>
<p id="hints">Paste list of hosts into text area, then click Go.
<br>Multiple lines are supported.
<br>Whitespace will be removed.</p>
<textarea id="textarea" ROWS=10 COLS=40>host1 host2 host3</textarea>
</p>
<button id="doit_button">Go</button>
<p id="result_text"></p>
<script type='text/javascript' src='http://code.jquery.com/jquery-git.js'></script>
<script type='text/javascript' src='genfilter.js'></script>
<link rel="stylesheet" type="text/css" href="style.css">
* {
font-family: sans-serif;
}
#hints {
color: gray;
}
p {
font-size: 12px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment