I will fix the greedy/non-greedy issue. I process the file line by line in a for loop. This is necessary because I sometimes need to check a few lines ahead. If I'm forced to process the file line by line instead of "slurp"ing the file, does that mean I can't regexp over multiple lines?