import re
p = re.compile(r'test\s*:\s*(.*)\.')
s = "test : match this."
m = p.search(s)           # Run a regex search anywhere inside a string
if m:                     # If there is a match
	print(m.group(1))     # Print Group 1 value