function reconstructString(theString) {
	var postcode;
	var townCity;
	var townCityRegularExpression = /^[^0-9]+$/;
	var postcodeRegularExpression = /^(\w){2,4}(\s){1}(\w){3}$/;
	var splitInput = theString.split(postcodeRegularExpression);
	var ismatchToenCity = townCityRegularExpression.test(theString);
	if(ismatchToenCity) {showAddress();} else {
		if(splitInput.length==1) {
			theString1=theString.substring(0,theString.length-3);
			theString2=theString.substring(theString.length-3);
			postcode=theString1+' '+theString2;
		} else {postcode=theString;}
		var ismatch = postcodeRegularExpression.test(postcode);
		if(!ismatch) {
			alert('It appears you have attempted to enter a postcode, but it is malformed and we are unable to make sense of it. UK post codes are in the format of 2-4 letters or numbers, followed by a space, followed by 3 letters or numbers.');
			document.homesearch.search.value='';
			return false;
		} else {document.homesearch.search.value=postcode;showAddress();}
	}
}
