```
clickhouse-local \
    --format_regexp_escaping_rule 'Raw' \
    --format_regexp_skip_unmatched 1 \
    --format_regexp '^([^ \.]+)(\.[^ ]+)? +([^ ]+) +(\d+) +(\d+)$' \
    --query "
SELECT replaceRegexpOne(_path, '^.+pageviews-(\\d{4})(\\d{2})(\\d{2})-(\\d{2})(\\d{2})(\\d{2}).gz$', '\1-\2-\3 \4-\5-\6')::DateTime AS time, * 
FROM file('pageviews*.gz', Regexp, 'project String, subproject String, path String, hits UInt64, size UInt64')"
```

```
Code: 117. DB::Exception: No \n after \r at the end of line.: (at row 148660)
: While executing ParallelParsingBlockInputFormat: While executing File. (INCORRECT_DATA)
```

```
clickhouse-local \
    --format_regexp_escaping_rule 'Raw' \
    --format_regexp_skip_unmatched 1 \
    --format_regexp '^([^ \.]+)(\.[^ ]+)? +([^ ]+) +(\d+) +(\d+).*?$' \
    --query "
SELECT replaceRegexpOne(_path, '^.+pageviews-(\\d{4})(\\d{2})(\\d{2})-(\\d{2})(\\d{2})(\\d{2}).gz$', '\1-\2-\3 \4-\5-\6')::DateTime AS time, * 
FROM file('pageviews*.gz', Regexp, 'project String, subproject String, path String, hits UInt64, size UInt64')"
```

```
Code: 117. DB::Exception: No \n after \r at the end of line.: (at row 148660)
: While executing ParallelParsingBlockInputFormat: While executing File. (INCORRECT_DATA)
```
{
    PeekableReadBufferCheckpoint checkpoint{buf};
    size_t line_size = 0;
    do
    {
        char * pos = find_first_symbols<'\n', '\r'>(buf.position(), buf.buffer().end());
        line_size += pos - buf.position();
        buf.position() = pos;
    } while (buf.position() == buf.buffer().end() && !buf.eof());
    buf.makeContinuousMemoryFromCheckpointToPos();
    buf.rollbackToCheckpoint();
    bool match = re2_st::RE2::FullMatchN(re2_st::StringPiece(buf.position(), line_size), regexp, re2_arguments_ptrs.data(), re2_arguments_ptrs.size());
    if (!match && !skip_unmatched)
        throw Exception("Line \"" + std::string(buf.position(), line_size) + "\" doesn't match the regexp.", ErrorCodes::INCORRECT_DATA);
    buf.position() += line_size;
    checkChar('\r', buf);
    if (!buf.eof() && !checkChar('\n', buf))
        throw Exception("No \\n after \\r at the end of line.", ErrorCodes::INCORRECT_DATA);
    return match;
}
RegexpRowInputFormat::RegexpRowInputFormat(