Note: When you load the data from example_seq.txt, your data will be delimted with newlines. You need to remove these before you can process using regular expressions, because Regular expressions only work on a line by ine basis. Use: .replace('\n','') Example: f = open('example_seq.txt') data = f.read().replace('\n','') ALSO: Note to solve the last Homework problem, using a one liner, you'll need to use look ahead assertations (?= R) See the re module python documentation for more information. John