Related regular expression

Regular Expression ---->Write a Python program that matches a word at the end of string, with optional punctuation.

#please provide code with explanation

As in this program we used re module

You can look this flowchart hope it will help you in understanding.

1 Like

why its giving, match found in 3rd statement of output …as it don’t have any punctuation?