Question: 
Write a function to check whether the given string starts and ends with the same character or not using regex.


Model's Code:
import re

def check_char(s):
    return "Valid" if re.match(r'^(.)\w*\1$', s) else "Invalid"



Sample Correct Code:
import re  
regex = r'^[a-z]$|^([a-z]).*\1$'
def check_char(string): 
	if(re.search(regex, string)): 
		return "Valid" 
	else: 
		return "Invalid" 


Asserts:
assert check_char("abba") == "Valid"
assert check_char("a") == "Valid"
assert check_char("abcd") == "Invalid"


Tests:
Test 1 of 3: PASS
Test 2 of 3: FAIL: AssertionError()

Test 396 of 974: 286/396 (72.22222222222221%): failed