User:Giorgi Eufshi/wildcard entry.js

var wildcard_entries = [ {		name: "season-episode contraction", regex: /S(\d)(\d)E(\d)(\d)/, success: function(match_result) {			if(match_result && match_result[1] && match_result[2] && match_result[3] && match_result[4]) {				var sN = parseInt(match_result[1])*10 + parseInt(match_result[2]); var eN = parseInt(match_result[3])*10 + parseInt(match_result[4]); return "Abbreviation of " + createHtmlLink("season") + " " + sN + ", " + createHtmlLink("season") + " " + eN + ""; }		}	} ];

function createHtmlLink(entry) {	return "" + entry + ""; }

function getWildcards(title) {	var res = ""; wildcard_entries.forEach(function(item, index){		res += wildcard_entries[index].success(title.match(wildcard_entries[index].regex));		res + " ";	}); return res; }

$(function{	var title = $(".mw-search-createlink .new").text;	var meanings = getWildcards(title);	$(".mw-search-createlink").after("There is no entry for it, but you may be looking for: " + meanings + " "); });