```
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)
```
{
    char * pos = in.position();
    bool need_more_data = true;
    size_t number_of_rows = 0;
    while (loadAtPosition(in, memory, pos) && need_more_data)
    {
        pos = find_first_symbols<'\n', '\r'>(pos, in.buffer().end());
        if (pos > in.buffer().end())
                throw Exception("Position in buffer is out of bounds. There must be a bug.", ErrorCodes::LOGICAL_ERROR);
        else if (pos == in.buffer().end())
            continue;
        
        if (*pos == '\r')
        {
            ++pos;
            if (pos == in.buffer().end())
                loadAtPosition(in, memory, pos);
        }
        if (memory.size() + static_cast<size_t>(pos - in.position()) >= min_chunk_size)
            need_more_data = false;
        ++pos;
        ++number_of_rows;
    }
    saveUpToPosition(in, memory, pos);
    return {loadAtPosition(in, memory, pos), number_of_rows};
}
void registerFileSegmentationEngineRegexp(FormatFactory & factory)