RegQuad You should call strip() on the results of all regexes. Have a look at the test cases to see example usages You can pass the name of a message file on the commandline using -f option info_regex.py -f C:\test\message.txt