Please send questions to
st10@humboldt.edu .
#---------------------------------------------------------
# Module name: re_play.py
# A simple 'framework' for playing with Python
# regular expressions (via the re module)
# By: Sharon M. Tuttle
# last modified: 10-18-05
#---------------------------------------------------------
import re
# my_regex_obj = re.compile(r'type MY RAW RE STRING here')
my_regex_obj = re.compile(r'[\s,.]')
for ctr in range(0, 5):
next_string = raw_input("next string to check: ")
found_it = my_regex_obj.search(next_string)
if found_it:
print 'MATCHED:', '<' + found_it.group() + '>', 'in',\
'<' + next_string + '>'
else:
print 'NO MATCH in', '<' + next_string + '>'
# end of re_play.py