Smile for me

Report a typo

Write a regular expression in the variable template in such a way that it would match the following smileys:

  • :)
  • :-)
  • :(
  • :-(
  • :o
  • :-o

Note that your regexp should not match any other smileys or random strings that do not contain them.

Write a program in Python 3
import re

# define regex template
template = ''
___

Create a free account to access the full topic