Add comments on line types and fix bugs in rexexp