Is it possible to use spaces in a re.compile()? For example, I want to make sure one space exists right before this string and right after it: re.compile ('\d{3,3}\.\d{3,3}\.\d{3,3}\.\d{3,3}') I've tried this, but it didn't work: re.compile (' \d{3,3}\.\d{3,3}\.\d{3,3}\.\d{3,3} ') Any ideas?