```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_
{
                        instructions.emplace_back(now);
                        now = "";
                    }
                    instructions.emplace_back(s[i + 1] - '0');
                }
                else
                    now += s[i + 1]; 
                ++i;
            }
            else
                now += s[i]; 
        }
        if (!now.empty())
        {
            instructions.emplace_back(now);
            now = "";
        }
        for (const auto & it : instructions)
            if (it.substitution_num >= num_captures)
                throw Exception(ErrorCodes::BAD_ARGUMENTS,
                    "Invalid replace instruction in replacement string. Id: {}, but regexp has only {} subpatterns",
                    it.substitution_num, num_captures - 1);
        return instructions;
    }
    static void processString(
        const re2_st::StringPiece & input,
        ColumnString::Chars & res_data,
        ColumnString::Offset & res_offset,
        re2_st::RE2 & searcher,