better regexp for line counting