This may not be enough for what you really want to do, but, given what you have shown above, regex is the wrong tool for the job.
Use the string method startswith: for line in ProcMem.split('\n'): if line.startswith( 'Mem' ): # do stuff -- http://mail.python.org/mailman/listinfo/python-list