```
SELECT version();

┌─version()────┐
│ 21.10.1.8002 │
└──────────────┘

WITH lower('\RealVNC\WinVNC4 /v password') as CommandLine
SELECT 
    CommandLine,
    CommandLine LIKE '%\\\\realvnc\\\\winvnc4%password%' as t1,
    CommandLine LIKE '%\\\\realvnc\\\\winvnc4 %password%' as t2,
    CommandLine LIKE '%\\\\realvnc\\\\winvnc4%password' as t3,
    CommandLine LIKE '%\\\\realvnc\\\\winvnc4 %password' as t4,
    CommandLine LIKE '%realvnc%winvnc4%password%' as t5,
    CommandLine LIKE '%\\\\winvnc4%password%' as t6;

┌─CommandLine──────────────────┬─t1─┬─t2─┬─t3─┬─t4─┬─t5─┬─t6─┐
│ \realvnc\winvnc4 /v password │  0 │  1 │  1 │  1 │  1 │  1 │
└──────────────────────────────┴────┴────┴────┴────┴────┴────┘

1 rows in set. Elapsed: 0.001 sec. 
```

All should match.

http://sqlfiddle.com/#!9/73f0c6/2
{
            size_t size = offsets.size();
            auto regexp = Regexps::get<like, true, case_insensitive>(pattern);
            std::string required_substring;
            bool is_trivial;
            bool required_substring_is_prefix; 
            regexp->getAnalyzeResult(required_substring, is_trivial, required_substring_is_prefix);
            if (required_substring.empty())
            {
                if (!regexp->getRE2()) 
                {
                    if (size)
                        memset(res.data(), 1, size * sizeof(res[0]));
                }
                else
                {
                    size_t prev_offset = 0;
                    for (size_t i = 0; i < size; ++i)
                    {
                        res[i] = revert
                            ^ regexp->getRE2()->Match(
                                  re2_st::StringPiece(reinterpret_cast<const char *>(&data[prev_offset]), offsets[i] - prev_offset - 1),
                                  0,
                                  offsets[i] - prev_offset - 1,
                                  re2_st::RE2::UNANCHORED,
                                  nullptr,
                                  0);
                        prev_offset = offsets[i];
                    }
                }