```
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
while (next_pos + n <= pos)
                        {
                            res[i] = revert;
                            next_pos += n;
                            ++i;
                        }
                        next_pos += n;
                        if (pos + strstr_pattern.size() <= next_pos)
                        {
                            
                            if (is_trivial)
                                res[i] = !revert;
                            else
                            {
                                const char * str_data = reinterpret_cast<const char *>(next_pos - n);
                                /** Even in the case of `required_substring_is_prefix` use UNANCHORED check for regexp,
                                *  so that it can match when `required_substring` occurs into the string several times,
                                *  and at the first occurrence, the regexp is not a match.
                                */
                                if (required_substring_is_prefix)
                                    res[i] = revert
                                        ^ regexp->getRE2()->Match(
                                            re2_st::StringPiece(str_data, n),
                                            reinterpret_cast<const char *>(pos) - str_data,
                                            n,
                                            re2_st::RE2::UNANCHORED,
                                            nullptr,
                                            0);
                                else
                                    res[i] = revert