Regex Emaple Py

Python has a module named re to work with RegEx. Here's an example:

import re

pattern = '^a...s$'
test_string = 'abyss'
result = re.match(pattern, test_string)

if result:
  print("Search successful.")
else:
  print("Search unsuccessful.")	
Modi ji