This expression matches first and last character as well as check for the string if length is 1 or not if it is simply check the first character.