Write a function that matches a word at the end of a string, with optional punctuation.
import re
def text_match_word(text):
        patterns = '\w+\S*$'
        if re.search(patterns,  text):
                return 'Found a match!'
        else:
                return 'Not matched!'
<s>[INST]<<SYS>>Given a task and its code, generate test cases for the code.<</SYS>>Write a function that matches a word at the end of a string, with optional punctuation.
import re
def text_match_word(text):
        patterns = '\w+\S*$'
        if re.search(patterns,  text):
                return 'Found a match!'
        else:
                return 'Not matched!'[/INST]assert text_match_word("python.")==('Found a match!')
assert text_match_word("python.")==('Found a match!')
assert text_match_word("  lang  .")==('Not matched!')</s>