It might be faster to define this function at module level scope rather than re-defining it each time is_range_line() called.