regex that will test string that begins and end with the same string character and also works if there is only one character in string