Do you care about statements, or just any line that contains something 'code-like-ish'. If the latter, i just use a regexp that looks something like this in VS: ^:b*:i ^ means match the beginning of ...