several regexp match fixes
make max_lines overridable from url