```sql
SELECT replaceRegexpAll('a', 'z*', '')
```

```
┌─replaceRegexpAll('a', 'z*', '')─┐
│                                 │
└─────────────────────────────────┘
```

```sql
SELECT replaceRegexpAll('aaaa', 'z*', '')
```

```
┌─replaceRegexpAll('aaaa', 'z*', '')─┐
│ aaa                                │
└────────────────────────────────────┘
```

Please create another issue.

_Originally posted by @alexey-milovidov in https://github.com/ClickHouse/ClickHouse/issues/35046#issuecomment-1061220789_
else
                    {
                        const auto & literal = it.literal;
                        res_data.resize(res_data.size() + literal.size());
                        memcpy(&res_data[res_offset], literal.data(), literal.size());
                        res_offset += literal.size();
                    }
                }
                if (replace_one)
                    can_finish_current_string = true;
                else if (match.length() == 0)
                    ++match_pos; 
            }
            else
                can_finish_current_string = true;
            
            if (can_finish_current_string)
            {
                res_data.resize(res_data.size() + input.length() - copy_pos);
                memcpySmallAllowReadWriteOverflow15(&res_data[res_offset], input.data() + copy_pos, input.length() - copy_pos);
                res_offset += input.length() - copy_pos;
                copy_pos = input.length();
                match_pos = copy_pos;
            }
        }
        res_data.resize(res_data.size() + 1);
        res_data[res_offset] = 0;
        ++res_offset;
    }
    static void vector(